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.

5 comments
^^ Again make sure that's not a local script or it won't function correctly.
Or you could say: if player.UserId ~= game.CreatorId then. But this would only work in a real server. Not studio.
That worked, thanks!
^^ I don't have 25 reputation yet, so take my imaginary upvote.
Hope the upvotes help