Is it Jasscraft or me?

Joker(Div)

Always Here..
Reaction score
86
Code:
function Trig_Demon_Strength_Actions takes nothing returns nothing
    local unit s = GetAttacker()
    local unit sc = CreateUnit( GetOwningPlayer(s), 'nzin', GetUnitX(s), GetUnitY(s), 0)
    call UnitAddAbility( sc, 'Auhf' )
    call SetUnitAbilityLevel(sc, 'Auhf', GetUnitAbilityLevel(s, 'A00I') )
    if GetRandomInt(1, 10) == 1) then
        call IssueTargetOrder( sc, "unholyfrenzy", s )
    endif
    call UnitRemoveAbility( sc, 'Auhf' )
    call RemoveUnit( sc )
    set s = null
    set sc = null
endfunction

//===========================================================================
function InitTrig_Demon_Strength takes nothing returns nothing
    set gg_trg_Demon_Strength = CreateTrigger(  )
    call TriggerRegisterAnyUnitEventBJ( gg_trg_Demon_Strength, EVENT_PLAYER_UNIT_ATTACKED )
    call TriggerAddAction( gg_trg_Demon_Strength, function Trig_Demon_Strength_Actions )
endfunction

Jasscraft says
Line 6: Syntax Error
Line 8: Missing Endfunction
Line 8: syntax error
Line 8: Statement outside of function
Line 8: Statement outside of function
Line 9: Undeclared Variable: s
Line 10: Statement outside of function
Line 11: Statement outside of function
Line 12: Undeclared Variable: sc
Line 12: Statement outside of function
Line 13: Statement outside of function
Line 13: Syntax error
Line 13: Statement outside of function
Line 13: Statement outside of function

I cant seem to find what i did wrong
 

Jazradel

Helping people do more by doing less.
Reaction score
102
Your 'if GetRandomInt(1, 10) == 1) then' has an extra bracket.
 
L

LucidWay

Guest
Also only the first error ever matters. Most of the time the resulting errors come from not being able to read the line that triggered the first error.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top