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

Music Manager won't change music?

The music won't change when the variable updates, can you help me?

loop = true
local Sound = script.Sound
id = 0
playingid = 0
wait(1)
local stage = script.parent.parent.CheckPointNumber.Value
while loop == true do
	if stage > 0 and stage < 2 then --Song1 
	id = script.Song1.Value
end
	if stage > 1 and stage < 3 then --Song2
	id = script.Song2.Value
end
	if stage > 2 and stage < 4 then --Song3
	id = script.Song3.Value
end
	if stage > 3 and stage < 5 then --Song4
	id = script.Song4.Value
end
	if stage > 4 and stage < 6 then --Song5
	id = script.Song5.Value
	end
	--Play--
	if id ~= playingid then
	Sound:Stop()
	Sound.SoundId = "http://www.roblox.com/asset/?id="..id
	Sound:Play()
	playingid = id
	end
	wait(1)
end

2 answers

✓ Accepted answer

Just have a sound and put a script in it, make the soundid something :Play() go down a line and use script.Parent.Ended:wait()

local sound = script.Parent while true do sound.soundid = "" sound:Play() sound.Ended:wait() sound.soundid = "" sound:Play() sound.Ended:wait() end

Nevermind, just found out how to fix it, the problem was that i was not updating the music

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