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

How to stop the song replaying itself when player respawns? [solved]

I have a script and it is an introduction song. But it tends to replay the script once the player resets or respawns his/her own character. Any advice on fixing the script to not allow it to replay the song upon reseting your own character?

local time = 42 
Game.Players.PlayerAdded:connect(function(plr)
	plr.CharacterAdded:connect(function(char)
        local song = Workspace.Introduction.WomanKing
        local clone = song:Clone()
        clone.Parent = plr
		wait(10)
        clone:Play()
        wait(45)
		clone.Volume = 0.6
		wait(0.2)
		clone.Volume = 0.5
		wait(0.2)
		clone.Volume = 0.4
		wait(0.2)
		clone.Volume = 0.3
		wait(0.2)
		clone.Volume = 0.2
		wait(0.2)
		clone.Volume = 0.1
		wait(0.2)
		clone.Volume = 0.0
        repeat
        clone:Stop()
        until clone.IsPlaying == false
	end)
end)

2 answers

✓ Accepted answer

Take out line 3.

Sorry I thought you meant to make it play every time someone spawns, by taking out line 3 it will only play when the player joins the game.

6 comments

1

Thank you so much @acecateer

0

:D

1

When i toke it out, the song stopped playing completely :(

0

That's because you have to take out the 'end)' on line 27, you should have a basic understanding of putting ends in scripts right?

1

Oh yea i forgot lol

0

Lol k.

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