So I made a ragdoll scripts which triggers a function where It plays a sounds everytime a ragdolled character collides with any surface, and Its ID deppends of the strength of the collision. The problem I got is that the sound played is only heard by the player, so if another player sees the other one collide, they can't hear the sound.
Do you know how to fix it?
I'll leave my script here. The "part" parameter are for the body parts of the character, such as the arms or the torso.
function playSound(part,intensity,bool)
if bool then
local sound = Instance.new("Sound",part)
sound.PlaybackSpeed = math.random(8,12)/10
if intensity < 5 then
sound.SoundId = "http://www.roblox.com/asset/?id=131237241"
sound.Volume = intensity/5
elseif intensity < 10 then
sound.SoundId = "http://www.roblox.com/asset/?id=74388682"
sound.Volume = 1
elseif intensity < 50 then
sound.SoundId = "http://www.roblox.com/asset/?id=1159504677"
sound.Volume = 1
else
sound.SoundId = "http://www.roblox.com/asset/?id=314390675"
sound.Volume = 3
end
sound:Play()
bool = false
wait(0.4)
bool = true
wait(1.6)
sound:Destroy()
end
end

2 comments
really? sounds are replicated from client to server
yep. By the way, the script is a localscript. Does that have something to do with sounds played only locally?