Alright, so. I'm currently scripting and making a Rolplay game for the Book Series Warriors, called Destiny of The Stars. I'd like to make it so that in the different Zones of the Clans, and the Spawn Area, different music plays, instead of it having just one, single, boring music that loops the whole time you're playing said RPG. Though, I do not know how to do this since I'm new to scripting. Any ideas?
COMMUNITY QUESTION
How to put different music in different zones?
1 answer
xaquizono's solution may be okay for you, but there's another way you can do this. Firstly, insert a Sound into Workspace (client or server-sided, doesn't matter). Next, have a part that acts as an "area" that the player will walk in. When the part is touched, the sound will play. When the part gets untouched, it will stop (or switch).
The script is fairly simple;
-- LocalScript
local sound = workspace:WaitForChild("Sound")
local hitbox = workspace:WaitForChild("Area1") -- Assuming we have a part in workspace called Area1
hitbox.Touched:Connect(function(part)
if part.Name == "Head" and part.Parent.Name == game.Players.LocalPlayer.Name then
sound.SoundId = "rbxassetid://" .. "Your sound ID"
sound:Play() -- Highly recommended to loop the sound
hitbox.TouchEnded:Wait() -- Yields the script until the part isn't touched anymore
sound:Stop()
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
Thankfully, this does not require any scripting what so ever! Go to the location you want the music to play, and Insert an object called "Sound". I recommend making it a child of something like a Part and making it invisible. In the sound properties, simply set the MaxDistance to a lower value, and you should be set!
Oh, I didn't think of that! Thank you! ^.^