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

How would you find the nearest part from the player's character? [closed]

Asked by
az_iee 19
6 years ago

Hello!

Does anyone know a script to find the nearest part from the player's character? That's all I want.

0
Thanks! az_iee 19 — 6y
0
Np. TheeDeathCaster 2368 — 6y

Closed as Not Constructive by Andorks

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

1 answer

Log in to vote
0
Answered by 6 years ago

get all the parts in workspace. create array with dictionaries that has part and magnitude between that part and character part (http://wiki.roblox.com/index.php?title=Magnitude) then loop through magnitudes and get the lowest number. part matching the lowest number in array is your desired part. this is just an idea and its kinda complicated but will probably work.

Ad