Change variable based on value (SOLVED)

Is there a better way I can change a variable based on the given value for example:

local active = 0

function level_data(self)
    if active == 0 then
        active = false
    else
        true
    end
end

I have a few variables that I would like to change in this way.

This should work:

active = not (active == 0)
5 Likes