I want to achieve it where my anti exploit kicks people instead of kills them.
I made the anti-exploit, however I do not know how to change it so the player gets kicked instead of killed.
I’ve tried looking for posts, but I cant so I thought making my own post could possibly work.
print("Pie's anti-exploit script loaded demo.")
me = script.Parent:FindFirstChild("Humanoid")
TestCounter = 0
lastTime = 0
lastState = 0
function checkstate(state)
--// Jump hack prevention
if state == Enum.HumanoidStateType.Seated then
if lastTime > os.time() - 1 then
TestCounter = TestCounter + 1
if TestCounter > 2 then
--// Kill the user
me.Health = 0
print(me.Parent.Name .. ", you were caught hacking.. :(")
else
print("Jump limiter: " .. TestCounter)
end
else
lastTime = os.time()
TestCounter = 0
end
end
--// Fly hack prevention
if state == Enum.HumanoidStateType.Flying then
me.Health = 0
print(me.Parent.Name .. ", you were just caught hacking.. :(")
end
--// Speed hack prevention
if me.WalkSpeed > 16 then
me.Health = 0
print(me.Parent.Name .. ", you were just caught hacking.. :(")
end
end
me.StateChanged:Connect(checkstate)
Thanks for looking, hopefully I can fix this soon!
Kicking on the Client is pretty bad, the exploiter might just disable the :Kick function. Teleporting them in the same game might work, but again, they can disable it on Client. Making an Anti Exploit on the Client may be good sometimes, place the anti exploit in a inportant Local Script(Something that the exploiter can do nothing without), so if he deletes it the game will be unplayable.
Yes, but if OP wants to create the Anti-Exploit on the client, the Exploiter may just disconnect all the connections from the Kick Remote(Please secure it, I don’t want a random Skid kick everyone). So the only thing you can do on the client without anyone advanced or not at exploiting just hooking Kick or anything else.
That whould just do unnecesary lag, and probably the exploiter can delete both. As I said, put the Anti-Exploit in a inportant script so when the Exploiter destroys it the game will become unplayable.