There doesn’t seem to be much help regarding how to get custom sounds for footsteps and etc. to be replicated to not just self but for everyone in the game.
Currently When I die I hear the custom death sound but on a seperate client it just hears oof. Same goes for stepping on specific material.
I tried to set up this:
--on death event in server
local PlayerName = player.Name
for i, v in pairs (Players:GetPlayers()) do
print(v.Name)
print(v)
print(player.Name)
if player.Name~=v.Name then
PlayerSounds:FireClient(v, PlayerName, "Death")
end
end
but whenever I sent the info, PlayerName (target for which sound need to play the custom sound), was nil
I was hoping to get the game.workspace[playername].character, then go into humanoid root part and play the death sound (I would also have to apply pitch volume id etc if applicable)
I’ve looked at other posts too but they don’t really solve the issue
EDIT: May have found a solution, going to sleep rn but if you’d like to check:
I would need to add a detection for stepping on materials and change the id pitches as I had done in starterplayercharacter scripts, assuming that it would function in this case. Ill pick up on it tomorrow.
It should, because this change will affect all users and require no remote events, just changes the default sound effect. I don’t see any reason you couldn’t do material checking as well. Good luck, let me know if it works tomorrow!
I have this script from an old project, it works perfectly for me, I hope it works for you.
(this script changes the action sounds for all players from the client)
Put this LocalScript in [StarterPlayer > StarterCharacterScripts]:
local Players = game.Players
function ActionSounds(obj)
local player = Players:GetPlayerFromCharacter(obj)
if not player then return end
local HRP = obj:WaitForChild("HumanoidRootPart")
HRP.Climbing.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3" --your ID sound
HRP.Died.SoundId = "rbxasset://sounds/uuhhh.mp3" --your ID sound
HRP.FreeFalling.SoundId = "rbxasset://sounds/action_falling.mp3" --your ID sound
HRP.GettingUp.SoundId = "rbxasset://sounds/action_get_up.mp3" --your ID sound
HRP.Jumping.SoundId = "rbxasset://sounds/action_jump.mp3" --your ID sound
HRP.Landing.SoundId = "rbxasset://sounds/action_jump_land.mp3" --your ID sound
HRP.Running.SoundId = "rbxasset://sounds/action_footsteps_plastic.mp3" --your ID sound
HRP.Splash.SoundId = "rbxasset://sounds/impact_water.mp3" --your ID sound
HRP.Swimming.SoundId = "rbxasset://sounds/action_swim.mp3" --your ID sound
end
workspace.ChildAdded:Connect(function(obj)
ActionSounds(obj)
end)
wait(2)
for i, obj in pairs (workspace:GetChildren()) do
ActionSounds(obj)
end