#help with my scipt pls

11 messages · Page 1 of 1 (latest)

shell minnow
#

oops

#

let me make it steamable

#

local plr = game.Players.LocalPlayer
local char = plr.Character
local humanoid = char.Humanoid
local oldHealth = humanoid.Health
local sound = char:WaitForChild("DamageSound")
local isPlaying = false
local debounce = false

humanoid.HealthChanged:Connect(function(health)
if not debounce and oldHealth > health and not isPlaying then
debounce = true
isPlaying = true
local newSound = sound:Clone()
newSound.Parent = char
newSound:Play()

    newSound.Ended:Connect(function()
        newSound:Destroy()
        isPlaying = false
        debounce = false
    end)
end
oldHealth = health

end)

dusk goblet
#

do you only want it to damage you once or whats the issue?

shell minnow
#

And only play once

dusk goblet
#

so if and audio plays bu its not finished and another audio plays the last one stops and the new one continues?

shell minnow
#

Yes

dusk goblet
#

Just clone the sound

#

Like create a new instance of it so you have 2 of the same sound out more