• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

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

Status
Not open for further replies.
Level 21
Joined
Mar 16, 2008
Messages
955
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.
Top