I am trying to make a script that kicks someone when they join but I keep getting the same error (sorry, ik this is probably the easiest script, but i forgot a lot about scripting)

game.Players.PlayerAdded:connect(function(player)
	wait(2)
    player:Kick()
end)

the output always says "Player is locked" or something like that.

3 comments

0

This looks like it would work unless Roblox Changed a few things.

0

I just ran a quick test and this seems to work fine.

0

Yeah, this should work fine. It may not work in LocalScripts, though.