what can I do to fix this? it does not work. pretty much what my goal is for it to play the song until the main menu is not visible.I double-checked and the names for everything are right
local song = game.Workspace.MainMenuTheme local main = game.StarterGui.Main repeat song:Play() until main.Start.Visible == false repeat song:Play() until main.Voting.Visible == false repeat song:Stop() until main.Start.Visible == true
Can you show me more how the script works?
main.Start:GetPropertyChangedSignal("Visible"):Connect(function() if main.Start.Visible == false then song:Stop() elseif main.Start.Visible == true then song:Play() end end
Whenever visibility changes, the function will fire and Stop/play the song depending if it is visible or not.