the song just plays in loop all the time, when something happens it changes the id of the songs, I did this on other scripts I have no idea why it’s not working on this one tho
looked up the songs/sounds … 15705896057 has a length of 0:00. The other is 0:48.
Try to just focus on the songs/sounds nothing else, in a separate script. Just to see if you can get that working. A simple play script.
I’ve went ahead and cleaned up the code a little bit, change it as you see fit. Note: You can separate things with a ; to clean up clutter.
Your sound ID is changing, the issue is that either the song you’re trying to use has been taken down (meaning; there’s nothing for the sound to play), or you aren’t playing the audio. I changed the audio ID of each audio, changed the Audios time position to 0, and played the audio. I also changed your while true do loop to a repeat function. It worked like a charm.
Fixed Script
local SS = game:GetService("ServerStorage");local BludBoss = SS.Maps:WaitForChild("BludBossFight");local NormalMap = SS.Maps:WaitForChild("MainMap")
local SSS = game:GetService("ServerScriptService");local MainTheme = game:GetService("Workspace").Music.MainSong
repeat
wait(5)
local Probability = math.random(1, 5)
print(Probability)
if Probability == 1 then
MainTheme.SoundId = "rbxassetid://1837879082";MainTheme.TimePosition = 0;MainTheme.Volume = 1;MainTheme:Play()
SSS.MeteorShowerEvent.Disabled = true
SSS.PortalEvent.Disabled = true
SSS.MapRegen.Disabled = true
local MSG = Instance.new("Message")
MSG.Parent = game.Workspace
MSG.Text = ("Regenerating map")
wait(2)
game.Workspace.Map:Remove()
game.Workspace.Terrain.Walls:Remove()
BludBoss.BludWalls:Clone().Parent = game.Workspace.Terrain;BludBoss.BLUD:Clone().Parent = game.Workspace.Terrain
SSS.BludAttacks.Attacks.Enabled = true
wait(2)
MSG:Remove()
wait(30) -- Done
SSS.MeteorShowerEvent.Enabled = true;SSS.PortalEvent.Enabled = true;SSS.MapRegen.Enabled = true
local MSG = Instance.new("Message");MSG.Parent = game.Workspace;MSG.Text = ("You survived Blud")
wait(2)
game.Workspace.Terrain.BludWalls:Remove();game.Workspace.Terrain.BLUD:Remove()
NormalMap.Map:Clone().Parent = game.Workspace;NormalMap.Walls:Clone().Parent = game.Workspace.Terrain
SSS.BludAttacks.Attacks.Disabled = true;SSS.BludAttacks.Script.Active.Value = false
MainTheme.SoundId = 'rbxassetid://1848354536';MainTheme.TimePosition = 0;MainTheme.Volume = 1;MainTheme:Play()
wait(2)
MSG:Remove()
end
until script.Disabled
If this doesn’t fix the issue, then make sure you have everything in-between correct. If you’re missing one thing; the whole script will break.
I found out that I had a script where if a value was false keep the id as the normal one, J2T script is very clean and easy to understand tho, deff will use it