Hello. I have made a script to detect the absolute deviation of the character's torso position to another given point. The variables and actual mathematical statement are working, but it's the if-then that doesn't allow it. I'll show you what I mean:
local player = game.Players.LocalPlayer
local char = player.Character
local givenPoint = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
local cpos = char.Torso.Position
local x = cpos.x
local xabsdev = math.abs(math.abs(x) - math.abs(givenPoint.x))
print(xabsdev) --this right here works as a number value
if 0 <= xabsdev <= 1 then
print('nfdlsa')
end
When I run this script, the print works perfectly, but it's the absolute deviation if-then statement that returns the error: attempt to compare boolean with number. How is 0 <= xabsdev <= 1 comparing a bool to a number? If this seems dumb please don't leave hateful comments, I have been trying to solve this for an hour. Thanks for reading and responding.

2 comments
Thanks! Worked like a charm
'Glad I could help. :)