local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local Character = LocalPlayer.Character
repeat wait() until LocalPlayer
repeat wait() until LocalPlayer.Character
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Anti = script.Parent:WaitForChild("Securing")
-- Flying
HumanoidRootPart.ChildAdded:connect(function(Obj)
if Obj:IsA("BodyPosition") or Obj:IsA("BodyVelocity") or Obj:IsA("BodyGyro")then
Obj:Destroy()
LocalPlayer:Kick("You've been caught trying to fly.")
end
end)
-- No Humanoid
Character.ChildRemoved:connect(function(Obj)
if Obj:IsA("Humanoid")then
LocalPlayer:Kick("You've been caught trying to destroy your humanoid.")
end
end)
while wait() do
if script.Parent:FindFirstChild("Securing") == nil then
LocalPlayer:Kick("You've been caught trying to disable the AntiExploit.")
elseif Anti.Disabled then
Anti.Disabled = false
end
end
What solutions have you tried so far?
So far i’ve tried re writing the script a couple times to make sure that I didn’t misspell anything. I also rewrote the script at the bottom portion of the script.
From the errormessage from the screenshot it looks like you are trying to find a child something that isn’t an object (maybe a property or nil). It looks like on line 10 you changed it to WaitForChild, so I would check in the explorer to make sure that the HumanoidRootPart is in character.
I would make a remote event (from client to server) that kicks the player on the server. Also, use the built-in parameter in the serverscript for the player (the first one).
Why are you even trusting the front-end for anti-exploit? It’s their machine, they can disable the LocalScript if they want to. It’s like using JavaScript to check inputs, it can be easily disabled.
Also you should stop using wait as seen on some of your codes.
Most anti-exploits are back-end as front-end anti-exploit can be disabled easily.