Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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


-------------------------------
--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

✓ Accepted answer

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

2 comments

0

I found an alternative way. But you did teach me something that will help me very much, so I still accepted the answer.

0

Glad i could be of help

This discussion is preserved as it was. New answers, comments, and votes are closed.