UPDATE: Please test your scripts before submitting them.
I need this for a test world to prevent others from coming in, but it doesn't seem to work online.
function removeplayer(player)
print(player.Name .. " has been kicked for attempting entry.")
player:remove()
end
function onPlayersEntered(tobechecked)
wait()
if not tobechecked.Name == "Player1" or not tobechecked.Name == "luigi970p" then -- Change luigi970p to your name
wait(1)
removeplayer(tobechecked)
end
end
game.Players.ChildAdded:connect(onPlayersEntered)

1 comment
This did not work. It just caused errors.