Script says object doesn't exist but it does

So I’m attempting to implement a custom walking sounds on different materials feature. The actual sounds playing and such aren’t the issue however. The issue lies in line 15:

c.HumanoidRootPart:WaitForChild("Running"):Destroy() -- c is taken from .CharacterAdded

This line of code is attempting to delete the default running sound. However, when I try, it does this.
image

I’ve tried putting a wait before it(up to a full second), and it still occurred. I’ve tried Debris:AddItem, but the warning still outputted. I’ve just now attempted to just set the volume to 0, but yet it still happens

Is there a boundary put on the server not allowing it to access these sounds? Why does it say it isn’t there, when it clearly is there? Please help me with this. Thanks!

That’s exactly the case. If you switch to Server view while testing in studio you will see that the server does not see the sounds. Put your code in a LocalScript in StarterCharacterScripts and it might work.

1 Like