WaitForChild infinite yield possible and FindFirstChild unable to find child when child exists

Screen Shot 2023-01-29 at 11.09.27 AM
as you can see, I am selecting the item thats supposed to be obtaind by the waiforchild, yet its just not finding it. Note that the item is indeed under humanoid root part, so I dont udnerstand why its not being found.

elseif cmd == "!unfly" then
			local char = effectedPlr.Character
			if char and char:FindFirstChild("flyHandler") then
				print("aaa")
				char:FindFirstChild("flyHandler").Enabled = false
				char:FindFirstChild("flyHandler"):Destroy()
				local hrp = char:FindFirstChild("HumanoidRootPart")
				print(hrp)
				print(hrp:WaitForChild("BodyVel"))
				if hrp:FindFirstChild("BodyVel") then
					hrp:FindFirstChild("BodyVel"):Destroy() 
					print("eee")
				end
				if hrp:FindFirstChild("BodyPosition") then 
					hrp:FindFirstChild("BodyPosition"):Destroy()
				end
			end
		end

thats the segment of my program thats responsible for finding the child. This is supposed to be part of an admin cmd script, which removes the flight script from the player and then remove the body velocity and body position from the player to avoid the player from floating

2 Likes

Have you checked to make sure that BodyVel exists on the server?

When in test play mode, toggle the ‘Current: Client’ button to server. Check under your HumanoidRootPart to make sure the instance exists on the server.

1 Like

oh my gosh im so darn stupid AAAAAA
I SPENT AN HOUR CHECKING IF I GOT THE ANCESTRY WRONG ND STUFF AND I FORGOT IT WAS LOCAL

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.