01 | local mat = workspace.Part |
02 | local debounce = false |
03 | local sc = workspace.mat |
04 | local hitm = sc.music |
05 |
06 | mat.Parent.Touched:Connect( function (hit) |
07 | if hit.Parent:FindFirstChild( "Torso" ) and debounce = = false then |
08 | hitm:Play() |
09 | wait(. 5 ) |
10 | hitm.Ended:Wait() |
11 | debounce = false |
12 | end |
13 | 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
Since Your "mat.Parent" = workspace do
01 | local mat = workspace.Part |
02 | local debounce = false |
03 | local sc = workspace.mat |
04 | local hitm = sc.music |
05 |
06 | mat.Touched:Connect( function (hit) |
07 | if hit.Parent:FindFirstChild( "Torso" ) and debounce = = false then |
08 | hitm:Play() |
09 | wait(. 5 ) |
10 | hitm.Ended:Wait() |
11 | debounce = false |
12 | end |
13 | end ) |