The script is located in game.StarterGui
The script is a "LocalScript"
-- Variables
local distPart = game.Workspace.distPart
local humRootPart = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart")
if (humRootPart - distPart).magnitude < 15 then
print("The Player Is In Range Of The Object!")
end
Here's the error that i'm getting : Players.ZOOP1015.PlayerGui.LocalScript:8: attempt to perform arithmetic (sub) on Instance

3 comments
I think you need to define Position aswell.Like (humRootPart.Position - distPart.Position).Magnitude
Woah, that was a silly mistake that i did, thanks for the answer! How do i accept your answer on this website exactly, it doens't give me the option to do so.
Yeah you can't accept a comment as an answer