Ok, I’m currently testing this method I will let you know if this works, and mark it as the solution.
This just kicks all player’s when they are added to the game.
1 Like
Then you can add some sort of check. If you need it as a remove event:
But you don’t need a remote event. You can just put some sort of check on the client, and kick the player.
RemoteEvent:FireServer()
That’s because this line of code is being executed from the local script meaning that every client is firing the server, you need to obscure it in some way so that it can’t be called by normal players only exploiters.
do
RemoteEvent:FireServer() --put this in some scope which makes it impossible to execute normally
end
RemoteEvent.OnServerEvent:Connect(function(Player)
plr:kick("reason")
end)
--the above connection is all you need, you dont need to put it inside a playeradded event
To add on to the idea of making sure no normal players can execute it, make sure not to check it on the client as exploiters can modify a lot more than some think. Make sure to check on the server, as exploiters cannot mess with server scripts/variables