Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I still don't hear audio playing someone help?

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

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)

1 comment

0

It isn't working still :/

This discussion is preserved as it was. New answers, comments, and votes are closed.