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
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
That is saying it has to be exactly 15 i need it to be 15 or less
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
use "<=" instead of "=="