I need to know how to make a script that does that but certain people can lay and not get kicked?
✓ ANSWER ACCEPTED
How to make a script that kicks all players that enter the game except certain people can enter it?
2 answers
✓ Accepted answer
Use the Kick method.
local PlayersWhichCanPlay = {masterhalo55 = true,
jobro13 = true}
game.Players.PlayerAdded:connect(function(Player)
if not PlayersWhichCanPlay[Player.Name] then
wait(3)
Player:Kick()
end
end)
That won't work. (Correct me with proof if I'm wrong)
local people={"trogyssy", "masterhalo55"}
Game.Players.PlayerAdded:connect(function(p)
local kick=true
for i=1, #people do
if p.Name==people[i] then kick=false end
if kick=true then p:Kick()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Jobro's works, there is no reason it wouldn't. The table is setup correctly (other than for usernames that start with numbers, such as mine), if that's what you're getting at.
But aren't names strings?