How would I do this?
When a player enters a specific part of the map, an audio plays. Right when they leave that area, the audio stops.
How would I do this?
When a player enters a specific part of the map, an audio plays. Right when they leave that area, the audio stops.
You could use magnitude to check how far away they are from that specific area or you could simply, as mentioned above, create an invisible part that plays the sound while being touched.
Here's the ROBLOX wiki link: http://wiki.roblox.com/index.php?title=Magnitude
Place a invisible part all over the area you want and then make a script like when he touch this part then the music plays :)
And a function when the player leaves the part - TouchEnded
To stop the music
It's so much better to use m39a9am3R's idea. But obviously a better explanation would be needed.
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Track the position of the user, use some math to figure out if a region's X, Y, and Z-axises is greater than or less than the user's position.