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

Running is not a valid member of HumanoidRootPart?

Asked by 1 year ago

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

Log in to vote
0
Answered by
NykoVania 231 Moderation Voter
1 year ago

Do it on local script

Ad
Log in to vote
0
Answered by 1 year ago
Edited 1 year ago

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

local HRP = script.Parent:WaitForChild("HumanoidRootPart", 120)
HRP.Running.Volume = 0
0
just inserting my code into a localscript did the trick but thanks SuperSM1 67 — 1y
Log in to vote
-1
Answered by 1 year ago

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
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. greatneil80 2647 — 1y

Answer this question