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

How to make every player that exist in Roblox admin?!!?

I want to make everyone in a playerlist of an Admin Model. The question is in the first line:

admins = {"Your Name Here"}

I want to put every players name in here but I cant just write every playername so is there a different way?!?!!? Model: https://www.roblox.com/library/5277383/Person299s-Admin-Command-Script

3 comments

0

Maybe something with playeradded!?

0

2:05 PM EST I Upvoted because you made me learn something about tables

0

Oh ok thx ;D ;)

1 answer

✓ Accepted answer

Just do this in the script!

admins = {
}

game.Players.PlayerAdded:Connect(function(Player)
	local Name = Player.Name
	table.insert(admins, Name)
end)
game.Players.PlayerRemoving:Connect(function(Player)
	local Delete = Player.Name
	table.remove(admins, Delete)
end)

1 comment

0

That is not how table.remove works. It needs the position of what the value in the table is. For a better description, see http://wiki.roblox.com/index.php?title=Global_namespace/Table_manipulation#table.remove

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