[AI] [solved] Confused why this apparently doesn't work?

Status
Not open for further replies.
Level 22
Joined
Mar 16, 2008
Messages
1,013
I don't see anything wrong with syntax here but this code apparently doesn't work. I eventually make this a longer combination that rolls 1-9 but just trying to get the code to work 1-2 first.

JASS:
function SelectHeroes takes nothing returns nothing
    local integer roll = GetRandomInt(1,2)
    if (roll = 1) then
        call SetHero( 1, 'H01G' )
        call SetHero( 2, 'H01L' )
    elseif (roll = 2) then
        call SetHero( 1, 'Hpal' )
        call SetHero( 2, 'H01L' )
    endif
endfunction
 
Status
Not open for further replies.
Back
Top