#help with my scipt pls
11 messages · Page 1 of 1 (latest)
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)
do you only want it to damage you once or whats the issue?
Oh ermmm I wanna it when you got attack at the same time it will not play the music 2 times
And only play once
so if and audio plays bu its not finished and another audio plays the last one stops and the new one continues?
Yes