How can I check if a number value’s value is less than 70 and grater than 50
just do this:
local Value = 66
if Value >= 50 and Value <= 70 then
print("under 70 but between 50")
end
3 Likes
Looks like the question is already answered, but I wanted to add something to anyone who views this page, You can create a function that receives an input, min and max that returns a Boolean back to you.
local number = 55 -- enter value here
-- function that returns a boolean
function inRange(input, min, max)
return input >= min and input <= max
end
local isBetween = inRange(number, 50, 70)
print(isBetween) -- returns true
Not hard-coding the min and max makes it more flexible for other use cases.