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

Call a function when a player enters a specific part of the map?

Asked by 8 years ago

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.

1
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. M39a9am3R 3210 — 8y

2 answers

Log in to vote
1
Answered by 8 years ago

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.

0
Here's the ROBLOX wiki link: http://wiki.roblox.com/index.php?title=Magnitude ShiftedGears 70 — 8y
Ad
Log in to vote
-1
Answered by 8 years ago

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 :)

0
And a function when the player leaves the part - TouchEnded Azmidium 388 — 8y
0
To stop the music Azmidium 388 — 8y
0
It's so much better to use m39a9am3R's idea. But obviously a better explanation would be needed. User#11440 120 — 8y

Answer this question