Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Trying to get Music to play in one area!?

First off I am MatthewWilson I just use this account because my other one was blocked from this website.

Second, can someone explain on how to have music play in one area so when you walk in lets say a cafe, cafe music plays and when you walk into the street, street music plays, I am needing this for my new game! Please help I need this to carry on! :(

2 comments

0

I am a bad Scripter :3

0

2 answers

If you want music to play in certain areas, here's my explanation, but it might be a tiny bit impractical. You can code it so that there's a huge part stretching through the street, while there's a part inside the cafe that can be touched so that cafe music may be played.

I'm not a great teacher, OK? :(

function onTouch(hit)
if hit.Parent:findFirstChild("Humanoid") then
script.Parent.Sound:Play()
end
script.Parent.Touched:connect(onTouch)

The script is quite messy, but you should get the idea.

You'll have to use local script for that. Put a script in the Starter GUI that will play certain music when in certain areas.

This discussion is preserved as it was. New answers, comments, and votes are closed.