Multiple If Statements

Hello!

I’m having an issue when using multiple IF statements. The code doesn’t seem to run :

:log info "Hi"
:local a 1
:local b 2
:local c 3


:if ($a=1) do={
:log info "A is definitely 1"} else={
:if ($a=2) do={
:log info "A is definitely 2"} else={
:log info "A is not 1 or 2"}

BUT if we remove the second if statement, the code runs perfectly fine:

:log info "Hi"
:local a 1
:local b 2
:local c 3


:if ($a=1) do={
:log info "A is definitely 1"} else={
:log info "A is not 1 or 2"}

What am i doing wrong?

If you fix your formatting, the problem becomes obvious: You’re missing a closing brace for the first else.

:if ($a=1) do={
    :log info "A is definitely 1"
} else={
    :if ($a=2) do={
        :log info "A is definitely 2"
    } else={
        :log info "A is not 1 or 2"
    }

Wow. I feel stupid. Thank You!