I’m trying to do a server-sided anticheat with an anti-fly system.
So, I want to kick player when BodyVelocity has been added in HumanoidRootPart, but ChildAdded doesn’t works. The script don’t have any errors.
Script:
game:GetService("Players").PlayerAdded:Connect(function(plr)
repeat wait() until plr.Character
wait(1)
local humr = plr.Character.HumanoidRootPart
while wait(1) do
humr.ChildAdded:Connect(function(adde)
if adde:IsA("BodyMover") or adde:IsA("BodyVelocity") or adde:IsA("BodyGyro") then
adde:Destroy()
wait(1)
print("it works!")
end
end)
end
end)
Thanks!