I have some difficulties to check the magnitude between a player and an object

Hey everyone!

I’m making a scipt to reduce the durability of an object (IntValue) and give to the player coins (Like a simple sim).
I’m trying to check the magnitude between the plr and the object.
It doesn’t work at all after the checking magnitude (ligne 16).

Does anybody can help me to find the bug here pls? :slight_smile:

Correct me if im wrong but

The “)” doesnt seem to connect with the dot

(v.Position - humRP.Position) .Magnitude
--try this
(v.Position - humRP.Position).magnitude

Also send your code rather than a picture just to check if theres actually a space between.

The positions work into the print and I don’t have any errors in the outout, it’s just do anything after the if (magnitude)

i will try this,
but I don’t know if it will works, thx for your help I’ll say you later if it worked

It doesn’t work, it doesn’t do anything :confused:

Instead of using (v.Position - HumRp.Position).Magnitude you could use Player:DistanceFromCharacter() as an alternative

Thx you for your help!

I already found the problem !
See ya