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
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

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

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)
0
What about "hitm" JerkDerekThe14alt 11 — 4y
0
I Edited The Post CoolMcroy 35 — 4y
Ad

Answer this question