attempt to index nil with 'WaitForChild'
--and
attempt to index nil with 'FindFirstChild'
Here are the scripts:
local LocalPLR = game.Players.LocalPlayer
local Char = LocalPLR.Character
local HRP = Char:WaitForChild("HumanoidRootPart")
HRP.ChildAdded:Connect(function(obj)
if obj.ClassName == "BodyGyro" or obj.ClassName == "BodyAngularVelocity" or obj.ClassName == "BodyPosition" or obj.ClassName == "BodyVelocity" or obj.ClassName == "BodyThrust" then
game.ReplicatedStorage.BanEvent:FireServer()
warn("Exploiter was detected, and banned.")
end
end)
This is just a simple anti-fly that runs on the client.
-- server sided one
if game.ServerScriptService:FindFirstChild("Anti-Fly"):FindFirstChild(tostring(Players[i])) ~= nil then
local LocalPLR = game.Players.LocalPlayer
local Char = LocalPLR.Character or LocalPLR.CharacterAdded:Wait()
local HRP = Char:WaitForChild("HumanoidRootPart")
HRP.ChildAdded:Connect(function(obj)
if obj.ClassName == "BodyGyro" or obj.ClassName == "BodyAngularVelocity" or obj.ClassName == "BodyPosition" or obj.ClassName == "BodyVelocity" or obj.ClassName == "BodyThrust" then
game.ReplicatedStorage.BanEvent:FireServer()
warn("Exploiter was detected, and banned.")
end
end)