Skip to content
This repository has been archived by the owner on Jan 1, 2023. It is now read-only.

Commit

Permalink
Promotion fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Neztore committed Apr 6, 2021
1 parent 2317504 commit 0e44ca0
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions games/promotion-centre/src/server/module/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -110,15 +110,20 @@ function Promo:handlePlayerJoin (Player)
else
-- tis' choosing time
RankPrompt(Player, groupId, promoRanks, function(newRank, newName)
local ranked = self.http:setRank(Player.UserId, newRank)
loadingScreen.hide()
if ranked.error then
Misc:displayError(Player, "Failed to rank you.", true)
else
Misc:displayMessage(Player, "Successfully ranked to "..newName, true)
if table.find(promoRanks, newRank) ~= nil then
local ranked = self.http:setRank(Player.UserId, newRank)
loadingScreen.hide()
if ranked.error then
Misc:displayError(Player, "Failed to rank you.", true)
else
Misc:displayMessage(Player, "Successfully ranked to "..newName, true)
end
wait(30)
Player:Kick("Done")
return;
end
wait(30)
Player:Kick("Done")
warn("ILLEGAL RANK SUPPLIED")
Player:Kick("Illegal rank supplied: This incident will be reported.")
end)
end
end)
Expand Down

0 comments on commit 0e44ca0

Please sign in to comment.