Ad
Log in to vote
1

Running is not a valid member of HumanoidRootPart?

Asked by 20 days 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 198 Moderation Voter
20 days ago

Do it on local script

Ad
Log in to vote
0
Answered by 19 days ago
Edited 19 days 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 52 — 17d
Log in to vote
-1
Answered by 20 days 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 2641 — 19d

Answer this question