Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Cant get sound to play with gui pop up?

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

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

`

This discussion is preserved as it was. New answers, comments, and votes are closed.