local rDROP = math.random(1, 100) -- Chance
if rDROP >= 1 and not rDROP >= 79 then
-- common
elseif rDROP >= 80 and not rDROP >= 99 then
-- rare
elseif rDROP >= 100 and not rDROP <= 99 then
-- epic
end
This is a theoretical chance script I want to use, and the reason it doesn’t work is because the “not rDROP <= x” is underlined orange, why is that? How do I make this work?
lua sees the and not rDROP <= x expression as and not rDROP
to fix this you have to surround it in parentheses
local rDROP = math.random(1, 100) -- Chance
if rDROP >= 1 and not (rDROP >= 79) then
-- common
elseif rDROP >= 80 and not (rDROP >= 99) then
-- rare
elseif rDROP >= 100 and not (rDROP <= 99) then
-- epic
end