Hello, I'm working on a script that will auto-kick anyone who isn't the owner of the game.
However, it isn't working. What am I doing wrong? This is my current code:
if game.Players.LocalPlayer.Name == "Phoenix_Ravin" then print("Welcome Authorized Player!") else game.Players.LocalPlayer:Kick ("You are not an authorized player.")
It's a LocalScript inside of the Workspace.
You're gonna want to add a Player Added function in a server script. Other than that, your script looks OK.
game.Players.PlayerAdded:Connect(function(player) if player.Name ~= "Phoenix_Ravin" then player:Kick("You are not an authorized player.") end end)