the output keeps saying Workspace.Part.Script:13: 'then' expected near '=' and i dont understand it. and im wondering if this their is a more efficient way
if game.Workspace.Timber:IsPlaying() = true then game.Workspace.NewStyle:Stop() end if game.Workspace.Timber:IsPlaying() = true then game.Workspace.Self:Stop() end
The :IsPlaying() method is more then likely recommended for sounds that are playing in the playergui.
It does not always work as planned when your using it as a global script since someone can join the game when the song was playing, and the song would still be playing for them, while everyone else has to wait until the recently joined players song finishes.
The only workaround is to play the sound in the players playergui, or to do it the ugly way is to make the script wait the length of the sound, stop it, and play the next one.
Just remember to put a message saying that if you recently joined, the first song you hear might be cut off early.
If you are not preloading your assets, It would be great to at up to 10 seconds before stopping and going to the next, since Roblox hasn't loaded the song to the client yet.
This should fix it.
if game.Workspace.Timber:IsPlaying() == true then
This is because you are checking if they are equal.(compares them not setting to a variable) As far as I know all if statements require a '=='