Answered by
8 years ago Edited 8 years ago
What you're trying to do is not allowed, as you're trying to kick a player the moment they join.
The reason this occurs is because you're trying to set the parent of something to something, while roblox itself is parenting the player to the Players service.
Simply typing in a wait()
inside of the function should make it work.
(I've also compacted your if statment)
2 | game.Players.PlayerAdded:connect( function (plr) |
4 | if not game:GetService( 'GamePassService' ):PlayerHasPass(plr,gamepass) and plr.UserId ~ = 8021038 and plr.UserId ~ = 161916404 then |