I am wanting to find how many studs are between an object(a part) and a player(character model).
What I thought of that didn't work:
firstpart = workspace.Part playerTorso = workspace.Player1.Torso math.max(firstpart,playerTorso)-math.min(firstpart,playerTorso)
How could I do this?
(Also, I am just making this script to show what I did in a simplified version, I know it would be an error if I ran the script I provided)
You would use magnitude. It gets the distance between 2 Vector3 Values.
firstpart = workspace.Part playerTorso = workspace.Player1.Torso local distance = (firstpart.Position - playerTorso.Position).magnitude
You would use "distance" to refer to the distance at any time.
You can read more on magnitude here.
Hope I helped. :)