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

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

Asked by 4 years ago
Edited by Ziffixture 4 years ago
01local mat = workspace.Part
02local debounce = false
03local sc = workspace.mat
04local hitm = sc.music
05 
06mat.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
13end)

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

0
code block. raid6n 2196 — 4y
0
mat.Parent is referencing workspace. Ziffixture 6913 — 4y
0
Ya mat.Parent = Workspace CoolMcroy 35 — 4y

1 answer

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

Since Your "mat.Parent" = workspace do

01local mat = workspace.Part
02local debounce = false
03local sc = workspace.mat
04local hitm = sc.music
05 
06mat.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
13end)
0
What about "hitm" JerkDerekThe14alt 11 — 4y
0
I Edited The Post CoolMcroy 35 — 4y
Ad

Answer this question