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

How do I make music play in certain areas?

Asked by 4 years ago

So im trying to get it to where when a player enters an area, a sound id starts playing and when they leave it stops.

Im pretty new to scripting but I have a general idea of things. From what I could find online im guessing I would have to use vector3 but I dont really know how to use it. At first I tried placinga huge part around my area and made it transparent and no collision and tried scripting it using Touched but couldnt get the sound to stop when the player left that area. Any ideas?

0
I am also relatively new to the language, so I am not completely sure how to do this, but I found a video from AlvinBlox that deals with sound regions. https://www.youtube.com/watch?v=L_Jga2MgRdU I hope this helped. demo86550 -5 — 4y
0
magnitude or parts greatneil80 2647 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

For this you may want to periodically check a region3 with a white list and have the white list updating with the players' characters. Then you can activate or deactivate the music based on where they are.

Keep in mind Region3 can be a bit slow or taxing sometimes so you really don't want the check happening too often, especially if you're checking several region3's so you may want to make the check only happen every 1-2 seconds.

Ad

Answer this question