• Best way to make a toggle function?
    4 replies, posted
I made this real quick, I want to know if there are better or shorter ways of toggling. [CODE] local toggle = false if toggle then toggle = true elseif !toggle then toggle = false end [/CODE]
[code]toggle = not toggle[/code]
That's much better than what I had.
[QUOTE=Winter;44260633][code]local toggle = false if toggle then toggle = !toggle elseif !toggle then toggle = !toggle end[/code][/QUOTE] You code is nonsense, you don't need an if/else, you just need: [code] toggle = not toggle [/code]
I know, I changed my post a while ago.
Sorry, you need to Log In to post a reply to this thread.