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

'if music.Played==false then' isn't working, can anyone here help? (RBLX LUA)

Asked by 7 years ago
01brick=script.Parent
02 
03music=brick.Parent.music
04 
05function onClicked()
06    if music.Played==false then
07        music:Play()
08    end
09end
10script.Parent.ClickDetector.MouseClick:connect(onClicked)

if anyone is able to help that'd be amazing! thanks. Any reply is helpful.

1 answer

Log in to vote
0
Answered by
Vulkarin 581 Moderation Voter
7 years ago

Use the property of sounds playing http://wiki.roblox.com/index.php?title=API:Class/Sound/Playing

1function onClicked()
2    if not music.Playing then
3        music:Play()
4    end
5end
0
Thanks! userdetail 1 — 7y
Ad

Answer this question