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

Running is not a valid member of HumanoidRootPart?

I'm so confused

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		char.HumanoidRootPart.Running.Volume = 0
	end)
end)

Running is, in fact, a member of HumanoidRootPart created by default when someone joins. I have tried using a wait() but it didn't work. I have tried using WaitForChild() but it just gave an infinite yield. Huh?

3 answers

Make this on a LocalScript in StarterCharacterScripts. Did it work?

local HRP = script.Parent:WaitForChild("HumanoidRootPart", 120)
HRP.Running.Volume = 0

1 comment

0

just inserting my code into a localscript did the trick but thanks

Try doing this!

game.Players.PlayerAdded:Connect(function(plr)
	plr.CharacterAdded:Connect(function(char)
		repeat task.wait() until char.HumanoidRootPart:FindFirstChild("Running")~=nil
		char.HumanoidRootPart.Running.Volume = 0
	end)
end)

It looks horrible, but it'll wait until the humanoid root part can find running, if roblox's built in functions don't work

1 comment

1

this is bad, waitforchild exists for a reason, this is polling and its incredibly worse than waitforchild. Also, "if roblox's built in functions don't work" implies roblox made it so that it works sometimes, this is wrong as well.

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