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

Damage sound script that doesnt work/play sound?

Asked by 7 years ago

I cant seem to hear this sound even after many tries + i dont think its working how it should

script V

while wait(0.05)do
local gethp=script.Parent.Humanoid.Health
if gethp > gethp 
    then
    local hurt= Instance.new("Sound",script.Parent.Head)
    hurt.SoundId="rbxassetid://209527158"
    script.Parent.Head.Died.SoundId=("rbxassetid://209527158")
    hurt:Play()

end 
end

Can you show me what to do and fix it?

1 answer

Log in to vote
0
Answered by 7 years ago

The sound will play, but you won't hear it because it isn't in the physical world. If you want everyone to hear it, parent the sound to workspace, but if you want only one person to hear it, parent it to PlayerGui.

If this helped you please remember to accept :)

0
But why i want it to be able tp be played In the head so every one can hear it when they are near my head Coolboyok11 64 — 7y
0
That's not how sounds work. If you parent it to the head, no one will be able to hear it. If you want people near your head to be able to hear it, then set the MaxDistance property of the sound to the desired number of studs you'd like a player to be near to hear the sound. DepressionSensei 315 — 7y
Ad

Answer this question