while true do
game.Players.photonfire.leaderstats.Rank.Value = "Admin"
game.Players.PhotonLightning.leaderstats.Rank.Value = "Admin"
end
I know that there will be an error if photonfire or PhotonLightning. So what do I do.
while true do
game.Players.photonfire.leaderstats.Rank.Value = "Admin"
game.Players.PhotonLightning.leaderstats.Rank.Value = "Admin"
end
I know that there will be an error if photonfire or PhotonLightning. So what do I do.
I've made a new script for you that's relative shorter if you see it in proportions.
local admins= {"Player1","Player2"} --The admins
function playeradded(plr)
wait()
for _,v in pairs(admins)do -- It "Scans" the table above called "Admins"
if plr.Name== v then --If Player is admin then it runs the code below
plr.leaderstats.Rank.Value= "Admin"
end
end
end
game.Players.PlayerAdded:connect(playeradded)
I'm sorry, I'm not that great in explaining but the above code will do. It also lags less because it will only run when a player is added.
Oh come on I wanted to answer the question xD
Do I put this script in ServerScriptService?
Yes
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Infinite loops crash the script.
Yes,cabbler is right,you should put a wait() in a while true do loop.