Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make certain people admin? My script doesn't work.

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.

2 comments

0

Infinite loops crash the script.

0

Yes,cabbler is right,you should put a wait() in a while true do loop.

1 answer

✓ Accepted answer

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.

3 comments

0

Oh come on I wanted to answer the question xD

0

Do I put this script in ServerScriptService?

0

Yes

This discussion is preserved as it was. New answers, comments, and votes are closed.