Hello, I have a script that requires the distance between the character (specifically the character's torso) and an object in Workspace. However, I can't find a way to access the Player's model! The code looks a bit like this (cropped to include relevant parts only):
while wait() do
local magnitude = (script.Parent.Position - game.Players.LocalPlayer.Character.Torso.Position).magnitude
if magnitude < 10 then
--code
elseif magnitude >= 10 then
--code
end
end
Obviously this doesn't work because LocalPlayer can only be used in LocalScripts. If anyone could find an answer, that'd be great. Thanks in advance!

2 comments
Aw man, does that mean it's impossible to use magnitude in a script? I appreciate the answer though. Thanks!
No, you can still use magnitude for this(: Just you have to think client side rather than server.