• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

[JASS] Do Elseifs work?

Status
Not open for further replies.
I just have a quick, simple question:

Do elseifs work?

Such as if I were to do something like this:
JASS:
function popoo takes nothing returns boolean
    if (GetUnitAbilityLevel(GetTriggerUnit(),'A000') == 1 then
    elseif IsUnitType(GetFilterUnit(),UNIT_TYPE_DEAD) then
    endif
    return false
endfunction

Note: This is just a quick example weird JASS thingy, please don't comment on how stupid it is or how to optimize it, I just want the answer to the question :emote_grin:

Will both "ifs" apply?

Any help is appreciated and rep might be given to those who help. :emote_smile:
 
Level 7
Joined
Jun 4, 2006
Messages
127
I'm not really sure but yes, ifs apply both in the endif function (or somethin like that) but don't accuse me if something bad happens. (because I'm too stoopid* to understand JASS scripting)

Remember, I'm not sure. I don't even know how to create JASS scipts but I can understand o_O
 
Level 8
Joined
Oct 20, 2004
Messages
66
Yes, it will work. I use it extensively. If the first condition returns false, it goes to the next elseif. If that returns false, it goes to the next elseif, and so on. It's basically like putting an If/Then/Else structure within the else of the first if, but it looks much more nicer.

Now if only I could use case structures...
 
Status
Not open for further replies.
Top