Hi, is there a way you can check if a player was kicked & what the kick message was/is? And if it’s a certain message it overrides the kick?
Recently, I have noticed many exploiters being able to ban players throughout a game…
Hi, is there a way you can check if a player was kicked & what the kick message was/is? And if it’s a certain message it overrides the kick?
Recently, I have noticed many exploiters being able to ban players throughout a game…
AFAIK, there is no way to distinguish a leave from a kick unfortunately.
Looking over the events available in the player class, including deprecated, only shows the following events.
Looking over the players (service) class only shows the following events:
You also can’t override a kick. Once the player is kicked, they are out of the game unless they manually rejoin.
I’ve also tried using ScriptContext.Error as what appears to be outputted is an error but it’s actually just red text, not an actual error.
Script:
local scriptContext = game:GetService('ScriptContext')
scriptContext.Error:Connect(function(...)
warn('new error ',...)
end)
game.Players.PlayerRemoving:Connect(function(...)
print('plr removed',...)
end)
game:GetService('Players'):WaitForChild('7z99'):Kick('test')
Output:
You probably have some vulnerability in your script which is causing players to be able to kick anyone they want. You should probably check the player’s UserId on the server side before actually kicking the player.
If you’d like to find out how an exploiter is able to do something, it’s almost always caused by a server script of yours that is accepting input from them and allowing them to tell the server to do something. So to find the root cause of your ban issue, you’re going to want to find all scripts in your game that use :Kick
and review them closely.
Think: If anyone could trigger this remote, would it activate for them without question? Could this be the remote that exploiters are using to ban random people?
If you have an actual ban system, check all code that adds bans into the system. Is there a remote that an exploiter could be using to ban people?
Usually, this is a side effect of having no permissions model. i.e. you think that if someone doesn’t have the Admin GUI, they can’t trigger the BanPlayer remote. But in reality exploiters can trigger anything they want without any GUIs, so you’re going to want to make sure the firing player actually is an admin before doing their bidding.