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

How Can I Find Out Where The Nearest Part Is?

i don't know how i can make a player go to the nearest part, can somebody tell me how I can do that?

2 answers

✓ Accepted answer

I See You Can Use Is MAGNITUDE For Example

local Part1 = script.Parent
local Part2 = script.Parent.Parent.Part2
local Magnitude = (Part1.Position - Part2.Position).Magnitude
print(Magnitude)
-- To Test This Be Sure That The Script Is In The Part Or You Can Just Change The Part1's Path And Make Sure You Have A Part Called Part2 Or Again Change Its Path

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