How to make sound not start over when you die?

Hello, I have just make a multiple sound looping script in my game. However, when I die,(it’s an obby)it restarts the music. Is there a way to fix this?

You could play the music from the server directly, or, you could put your scripts in a GUI and have the ResetOnSpawn property in that GUI set to false.

2 Likes

Sorry, but how could I play it from the server?

In the server-sided script, you would put:

Instance.Looped = true
Instance:Play()
1 Like

Wait, so here is my script. Where would I put it?
local sound1 = 1838660362
local sound2 = 1837767023
local sound3 = 1840030986
local sound4 = 1837711983
local sound5 = 1839685658
local sound6 = 1839246747
local sound7 = 1842104216
local sound8 = 1837765984
local music = script.Parent
while true do
wait()
music.SoundId = “rbxassetid://”…sound1
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound2
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound3
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound4
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound5
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound6
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound7
music:Play()
music.Ended:Wait()

music.SoundId = "rbxassetid://"..sound8
music:Play()
music.Ended:Wait()

end

It can be in any script you want it to be, as long it is a script, NOT a local script

I know, but where in the script I posted above?

Like, in what part(30 characters)

Doesn’t have to be a script for this to function properly. The PlayerScripts folder doesn’t refresh its contents on death so if you put a LocalScript there that controls music, it’ll work just fine. Other errors can be debugged or fixed by OP first, using the console and such to their advantage.

2 Likes

I just want to know how I could make the sound not start over when I die in my game in my specific script. I will provide the script again.

local sound1 = 1838660362
local sound2 = 1837767023
local sound3 = 1840030986
local sound4 = 1837711983
local sound5 = 1839685658
local sound6 = 1839246747
local sound7 = 1842104216
local sound8 = 1837765984 
local music = script.Parent


while true do
	wait()
	music.SoundId = "rbxassetid://"..sound1
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound2
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound3
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound4
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound5
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound6
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound7
	music:Play()
	music.Ended:Wait()
	
	music.SoundId = "rbxassetid://"..sound8
	music:Play()
	music.Ended:Wait()
	
	

	
	
end

I’m a beginner sorry. Also sorry if this came off as rude.