ex
if game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Part.Position.magnitude == 15 then print("hi") end
basically that but if the mag is 15 or lower
The <
operator "less than" let's you do that. You can additionally combine it with =
, giving you <=
"less than or equal to".
local plr = game.Players.LocalPlayer local hrp = plr.Character.HumanoidRootPart if (hrp.Position - Part.Position).magnitude <= 15 then print("hi") end
Make it on ()
Example:
local Part = workspace.Part_ok if (game.Players.LocalPlayer.Character.HumanoidRootPart.Position - Part.Position).magnitude == 15 then print("Hi!") end