I have this script that has custom material footstep sounds. The problem is that I’m working on a survival PVP game and I want the footsteps to be muted unless you are close by to a player. I’ve lowered the range at which you can hear the footsteps, but players can still hear the default footstep sound. How can I mute that?
Roblox creates a Running sound in the HumanoidRootPart. You can delete it with something like
if hrp:FindFirstChild("Running") then hrp.Running:Destroy() end
What is the hrp? (this is definitely not a bypass lol)
The humanoidrootpart inside a character
game.Players.PlayerAdded:connect(function(p)
p.CharacterAdded:connect(function(c)
local x = script:GetChildren()
if c:FindFirstChild('HumanoidRootPart') then
c.HumanoidRootPart.Running:Destroy()
end
I tried this but I got
Running is not a valid member of Part "asunoandkrito.HumanoidRootPart
Do that once the character is fully loaded
I added a wait(1), but I still got the same error in output.
Use the Player.CharacterAdded event
maybe try something like this
local players = game.Players
players.PlayersAdded:Connect(function(plr)
plr.CharacterAdded:Connect(function(char)
if char.HumanoidRootPart:FindFirstChild("Running") then
char.HumanoidRootPart:FindFirstChild("Running"):Destroy()
end
end
end)
wrote this is a bit of a rush. Basically when the player is added the code will wait for the character to be added and destroy the running sound. Im not sure if this code will work since i wrote it in such a rush but i hope it helps!
If you don’t care about other sounds, you could just insert a blank script into StarterCharacterScripts and call it Sound
.
change HumanoidRootPart to just Humanoid i think it might work
c.HumanoidRootPart:WaitForChild(“Running”):Destroy()
i believe the footstep sound is only on the client and it has to be a local script
Please avoid using ‘wait’. It’s the worst way of delaying something, and it can cause some issues. You better use task.wait or runservice instead, they’re better and much more efficient.
Or in this case, :waitForChild()
.
I don’t know if this problem is fixed but the server has no part in character sounds. You can only use a local script to mute them, and this would only mute them for yourself. If you want to mute it for everyone then you would have to fire a remote event to all clients and then each client would mute it.
local humanoidRootPart = script.Parent:WaitForChild("HumanoidRootPart")
local RunSound = humanoidRootPart:WaitForChild("Running")
RunSound:Destroy()
put this in a local script in startercharacterscripts, should work just fine