Finding the closest positions on a part to the player

Hello! I’ve had some issues trying to make a system where the player will place a trap on the path but I don’t know how the script would be able to find the closest position or near the closest position from the player to path within a range

(It is 12am my time and I will be logging off for now)

You can script it so that when the player confirms the placement of the trap, it checks whether or not if it’s on the path and calculate the distance between the trap and the player. If the distance is too far you cancel the placement and vice versa.

issue with this is, the player doesn’t get to chose

What do you mean by doesn’t get to choose?