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
brick=script.Parent

music=brick.Parent.music

function onClicked()
    if music.Played==false then
        music:Play()
    end
end
script.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

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

Answer this question