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

Way to delete default sound? Foot steps?

Asked by
bloxxyz 274 Moderation Voter
10 years ago

I wanted to add my own custom footsteps, I have the script ready, but is there a way to remove default sounds like the foot steps and jumping etc? Both sounds overlap and I don't want that. I know you can remove leaderboards and chat, and I have done that successfully, but is there a line of code that removes sounds given default by ROBLOX games, or replaces them? I've seen developers do this before and I feel the default roblox sounds are too lively for the game I plan to make.

I hope I'm not asking for too much, if it's more than a few lines of code I'd just like an idea of how I'd do this.

Thank you!

2 answers

Log in to vote
3
Answered by 10 years ago

Replace the default ID's with the sound you want. So for line 3 you could do:

rbxasset://sounds/action_footsteps_plastic.mp3"] = "rbxassetid://143959455";

You can place this as a normal script in the workspace.

local soundIds = {
    ["rbxasset://sounds/action_falling.mp3"] = "rbxasset://sounds/action_falling.mp3";
    ["rbxasset://sounds/action_footsteps_plastic.mp3"] = "action_footsteps_plastic.mp3";
    ["rbxasset://sounds/action_get_up.mp3"] = "rbxasset://sounds/action_get_up.mp3";
    ["rbxasset://sounds/action_jump.mp3"] = "rbxasset://sounds/action_jump.mp3";
    ["rbxasset://sounds/action_jump_land.mp3"] = "rbxasset://sounds/action_jump_land.mp3";
    ["rbxasset://sounds/action_swim.mp3"] = "rbxasset://sounds/action_swim.mp3";
    ["rbxasset://sounds/impact_water.mp3"] = "rbxasset://sounds/impact_water.mp3";
    ["rbxasset://sounds/splat.wav"] = "rbxasset://sounds/splat.wav";
    ["rbxasset://sounds/uuhhh.mp3"] = "rbxasset://sounds/uuhhh.mp3";
}

local function fixSound(instance)
    if (instance:IsA("Sound")) then
        instance.SoundId = (soundIds[instance.SoundId] or instance.SoundId)
    end
end

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
        for _, child in next, character.Head:GetChildren() do
            fixSound(child)
        end
        character.Head.ChildAdded:connect(fixSound)
    end)
end)
Ad
Log in to vote
-2
Answered by
atank1 -2
10 years ago

Try making a loop for after your death! :D

0
wth CaptainAlien132 225 — 6y

Answer this question