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"
Try doing an if statement like
~~~~~~~~~~~~~~~~~
if script.Parent.Visible == true then
script.Song:play()
end
~~~~~~~~~~~~~~~~~