Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to change room music as you switch areas?

Asked by
iBuizel 15
8 years ago

Like "Work at a Pizza Place", when you enter your house, it may play your custom music in different rooms, but when you exit your home, it plays another music but it does not affect the surrounding players. Anyone knows how to do these kind of things?

0
I think it would work in a LocalScript, I am gonna try it. TheDeadlyPanther 2460 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I will send you the model, since it a big script, but basically:

--[[ 
STEP 1:
Make a script in Workspace that puts the a LocalScript called "MusicScript" in the player's character.
STEP 2:
Put in Parts to be the room.
Set up all the locals and compare strings/numbers etc. inside the MusicScript.
STEP 3:
Create functions that trigger when the player touches the part - when the player is touching, the main music gets :Pause()ed and the room music gets :Play()ed.
Create functions that trigger when the player .TouchEnded the Part - room music pauses, main music plays.
STEP 4:
Repeat until done (copy + paste is useful)
]]--

That was the main idea, and here are the scripts: http://www.roblox.com/Room-Music-Script-item?id=298178867

Note: I have encountered problems when playing the songs, but they can be fixed with some fiddling (and also, this is how to, not please do it for me ).

Hope I helped :)

Ad

Answer this question