Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

My anti-fly exploit is not working and is claiming that "HumanoidRootPart" is not in the player?

Asked by
SpiralRBX 224 Moderation Voter
5 years ago
Edited 5 years ago

------------------------------- --random name math.randomseed(os.time()) for i = 1,157 do local name = math.random() script.Name = name end --so hackers cant delete the script -------------------------------- local plr = game.Players.LocalPlayer local bp = plr.Backpack local char = plr.Character --Fly char.HumanoidRootPart.ChildAdded:connect(function(l) if l.ClassName ~= "BodyGyro" then plr:Kick("Fly Hacking") end end) char.UpperTorso.ChildAdded:connect(function(l) if l.ClassName ~= "BodyGyro" then plr:Kick("Fly Hacking") end end) char.LowerTorso.ChildAdded:connect(function(l) if l.ClassName ~= "BodyGyro" then plr:Kick("Fly Hacking") end end)

This script was to kick players who are fly hacking, but I keep getting "HumanoidRootPart is not in model" in console? Any fixes?

1 answer

Log in to vote
1
Answered by
Nogalo 148
5 years ago

It is often useful to wait for some parts

local hum = player.Character:WaitForChild("HumanoidRootPart")

Creating a starting variable like this will often solve the problem

0
I found an alternative way. But you did teach me something that will help me very much, so I still accepted the answer. SpiralRBX 224 — 5y
0
Glad i could be of help Nogalo 148 — 5y
Ad

Answer this question