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
Basically, You You need to check for the Positions of the both, that's how you use Position. To get the Vector3 Values eg of humRootPart and the ****distPart****
-- Variables local distPart = game.Workspace.distPart local humRootPart = game.Players.LocalPlayer.Character:WaitForChild("HumanoidRootPart") if (humRootPart.Position - distPart.Position).magnitude < 15 then print("The Player Is In Range Of The Object!") end