So this music playing script re-starts everytime the person dies, but I didn't want it to work like that, I just wanted the music to continue from where it was. It is a local script and is located inside the StarterGUI
local song = game.Workspace.Songs local function playmusic() while true do song.ET:Play() wait(121) song.Bangarang:Play() wait(96) song.DarudeSand:Play() wait(230) song.Poison:Play() wait(123) end end playmusic()
So you will need another script for this due to that infinite loop in the one you have now This one you will put in starterscripts or you might actually be able to put this script inside your other script or the other script's parent.
--just change the hierarchy so it finds humanoid script.Parent.Humanoid.Health.Changed:Connect(function() script.Value1.Value = song.ET.TimePosition script.Value2.Value = song.Bangarang.TimePosition script.Value3.Value = song.DarudeSand.TimePosition script.Value4.Value = song.Poison.TimePosition end)
You will need to create number values for each song and store them wherever it is easiest to access them from both scripts.
This one is your current script
local song = game.Workspace.Songs local function playmusic() while true do song.ET.TimePosition=script.Value1.Value song.ET:Play() wait(121) song.Bangarang.TimePosition=script.Value2.Value song.Bangarang:Play() wait(96) song.DarudeSand.TimePosition=script.Value3.Value song.DarudeSand:Play() wait(230) song.Poison.Value4.Value song.Poison:Play() wait(123) end end playmusic()
Because I don't know the hierarchy in your game, you will have to change the hierarchies so that they match up, but this is the best solution to your problem once you get it set up.
What you will need to do is disable "ResetOnSpawn" on the screen gui so it will not reset the gui once respawned.
Just encountered this problem. My solution was waaaaay simpler. I've just changed "play" to "resume" and it worked :D
i have the same problem and our tips didnt help i also tried to move song to workspace didnt work heres the script:~~~~~~~~~~~~~~~~~ local MarketPlaceService = game:GetService("MarketplaceService")
local Songs = {
1837849285,
1837848642,
5410080771,
1846420141
}
local SongObject = script.Parent.Song local SongLabel = script.Parent.SongLabel local SkipButton = script.Parent.Parent.Settings.Frame.SkipButton local MuteButton = script.Parent.Parent.Settings.Frame.MuteButton
MuteButton.MouseButton1Click:Connect(function() if SongObject.Volume == 0.5 then SongObject.Volume = 0 else SongObject.Volume = 0.5 end end)
SkipButton.MouseButton1Click:Connect(function() SongObject:Stop() end)
while true do for i = 1, #Songs do local Song = Songs[i] local SongInfo = MarketPlaceService:GetProductInfo(Song)
SongObject.SoundId = "rbxassetid://" .. Song SongObject:Play() SongLabel.Visible = true SongLabel.Text = SongInfo.Name wait(3) SongLabel.Visible = false repeat wait() until not SongObject.IsPlaying end
end
~~~~~~~~~~~~~~~~~