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

I still don't hear audio playing someone help?

Asked by 4 years ago

local mat = workspace.Part local debounce = false local hitm = mat.music

mat.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Torso") and debounce == true then
           hitm:Play()
           wait(.5)
           hitm.Ended:Wait()
           debounce = false     end
end)

1 answer

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

Your debounce starts off false so the code is never run since you're looking for whether the debounce is true.

local mat = workspace.Part 
local debounce = false 
local hitm = mat.music
mat.Touched:Connect(function(hit)
    if hit.Parent:FindFirstChild("Torso") and debounce == false then
        debounce = true
        hitm:Play()
        wait(.5)
        hitm.Ended:Wait()
        debounce = false
    end
end)
0
It isn't working still :/ JerkDerekThe14alt 11 — 4y
Ad

Answer this question