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

Cant get sound to play with gui pop up?

Asked by 4 years ago
Edited 4 years ago

I have a gui in starter gui at which a random amount of seconds it comes up with a sound I have gotten the gui to be able to come up but I can find out how to get the sound to come up too. This is a 1 player game so I don't care about playing it server-side or locally this is my current script

while true do"

    script.Parent.Visible = false --it's invisable"

    wait(math.random(2,3)) "

    script.Song:play()"

    script.Parent.Visible = true --makes it visable"

    wait(0.5) --how long it stays visible"     

    script.Parent.Visible = false --makes it invisable again"

    end"

1 answer

Log in to vote
0
Answered by 4 years ago

Try doing an if statement like ~~~~~~~~~~~~~~~~~ if script.Parent.Visible == true then script.Song:play() end ~~~~~~~~~~~~~~~~~

Ad

Answer this question