Can somebody help me? For some reason, my audio sound script work perfectly when I tested it in the studio and not in the actual game. How come? The brick make sound when someone step or touch the "Part" and the sound will play. I tried to added in the "Time Length" which is on line 7 and it work just fine in the studio but when I tested it in the actual game the script doesn't work.
You can also check my layout script if you are confuse:
https://gyazo.com/ceeaeb00fda00022dc87fe1236b66e24
local ready = true -- defines "ready" script.Parent.Touched:connect(function() if ready == true then ready = false script.Parent.Sound:Play() wait(script.Parent.Sound.TimeLength) -- the part you wanted print("finished playing") wait(3) print("3 seconds have passed") ready = true end end)
The TimeLenght is for visual only, this means scripts Can't edit or use it
Not really very sure about it
local ready = false script.Parent.Touched:connect(function() if ready == true then ready = false script.Parent.Sound:Play() script.Parent.Sound.Ended:connect(function() -- The part where we get the information the sound ended print("Finished playing") wait(3) print("3 seconds passed") ready = true end) end end)
Hope this works for you as i haven't tested this