Okay so this is pretty simple I've never used a command like this I should be able to debug it but it's got me stuck.
This is what I have:
if Player.Name ~= "shockyman101" then Player.Name:remove() end
I'm currently making a game but I want it close to public so when people join I want it to automatically remove them from the game.
If you could help me debug this that would be great.
Your problem is actually in the second line of code there.
Player.Name
is a string, and strings do not have a remove
method. As well, the remove
method for ROBLOX objects is deprecated.
Try this instead:
if Player.Name ~= "shockyman101" then Player:Kick() end
The Kick
method of Player objects will remove the Player being kicked from the Game, while also disconnecting them so that they can't exploit and get back into the game without their Player.