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

not working at all I don't hear the audio playing? (More Info BELOW THE CODE)

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

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

So this is the code yes I have the audio inside of mat. Maybe I have to change some of the lines help anyone

3 comments

0

code block.

0

mat.Parent is referencing workspace.

0

Ya mat.Parent = Workspace

1 answer

✓ Accepted answer

Since Your "mat.Parent" = workspace do

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

2 comments

0

What about "hitm"

0

I Edited The Post

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