I'm trying to make it so if the leaderstats of the character is greater than 1 then a welcome back audio plays. The location of everything in the script is correct. I do not know why it will not play.
function onPlayerEntered(player)
if player.leaderstats.Stage.Value < 1
then game.Workspace.Sounds.Welcomeback:play()
wait(8)
game.Workspace.Sounds.Welcomeback.Volume = .4
wait(.5)
game.Workspace.Sounds.Welcomeback.Volume = .3
wait(.5)
game.Workspace.Sounds.Welcomeback.Volume = .2
wait(.5)
game.Workspace.Sounds.Welcomeback.Volume = .1
wait(.5)
game.Workspace.Sounds.Welcomeback:pause()
end
game.Players.PlayerAdded:connect(onPlayerEntered)
Thank you for the help.

2 comments
Is the stage value Loaded before you try to play it? Try adding a player:WaitForDataReady() then try it.
In line 2 why are searching to see if a leaderstat's stage is less than 1 when you mentioned you are searching the leaderstat's stage to see if its greater than 1?!?