So I'm playing around with the Disaster Kit V2 and I made a map rotation system, and I want to make every map have a different background music, but when the map changes, the song keeps playing. How can I make it so specific music only plays on it's specific map?
Here's the script for the map changing if it helps:
function regenStructures()
workspace.Structures:ClearAllChildren()
local maps = game.ServerStorage.Clones.Maps:GetChildren()
local mapCopy = maps[math.random(1, #maps)]:Clone()
mapCopy.Parent = workspace.Structures
mapCopy:MakeJoints()
end

1 comment
well... the easiest way is to create a part where the players spawn and have a script inside of it and when the players touches it, the music plays. Or you can make a script that whenever a map changes or the game starts, the music starts playing and afterwards, it gets destroyed and so on.