Recently I discovered that exploiters were killing everyone in a game by attaching themselves to other players the way most exploit bring scripts do and then setting the HumanoidState to dead. For some reason that replicates.
Since many exploit scripts rely on deleting or manipulating the Humanoid in some way and since deleting a Humanoid from the client apparently replicates to the server, I’d like to somehow use that to my advantage.
The issue I’m at currently is trying to avoid false positives such as resetting which naturally parent the Humanoid to nil. I’d like to check to see if exploiters are deleting the Humanoid from the server and then carry out some sort of disciplinary action. What I have so far is this:
game.Players.PlayerAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
local h = char:WaitForChild("Humanoid")
h.AncestryChanged:Connect(function(_, parent)
if not parent then
local h = plr.Character:FindFirstChild("Humanoid")
if not h then
print("Humanoid Deleted.") -- Do something here.
end
end
end)
end)
end)
Are there any issues with my approach, and what alternatives can you think of if possible?