turok255
New Member
- Reaction score
- 30
Im playing around with JASS like all the tutorials said and I was just wondering, How can I change globals from locals?
I did this
All I did was change the set global to a local and take the udg_ part away, Is there somthing els I have to do?
And got 3 errors,
Line28: Expected endif
Line29: Expected a name
Line33: Expected a name
Im using NewGen WE if it matters.
I did this
Code:
function Trig_Unit_Attacks_Func001C takes nothing returns boolean
if ( not ( GetUnitTypeId(GetTriggerUnit()) == 'Hpal' ) ) then
return false
endif
return true
endfunction
function Trig_Unit_Attacks_Actions takes nothing returns nothing
if ( Trig_Unit_Attacks_Func001C() ) then
local unit u=GetTriggerUnit()
call IssueImmediateOrderBJ( u, "divineshield" )
else
endif
call TriggerSleepAction( 2.00 )
call IssueImmediateOrderBJ( u, "undivineshield" )
endfunction
//===========================================================================
function InitTrig_Unit_Attacks takes nothing returns nothing
set gg_trg_Unit_Attacks = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Unit_Attacks, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddAction( gg_trg_Unit_Attacks, function Trig_Unit_Attacks_Actions )
endfunction
And got 3 errors,
Line28: Expected endif
Line29: Expected a name
Line33: Expected a name
Im using NewGen WE if it matters.