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

How do I make a proximity based script?

Not sure if this type of question is allowed but I really just don't know how I would go about making this. I'm attempting to make a script that will only activate once a players comes within a certain distance of a part. Upon them entering the zone the script triggers. Anybody have some suggestions about how I could do this?

1 answer

✓ Accepted answer

Hello, TheFirstPhire!

You can get the player pos and the part pos and the make something like: (PLAYERPOS - PARTPOS).magnitude, this will give the distance between the parts =D you'll just need to use a if to test the distance!

Good Luck with your games

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