I'm using the local point "Infusion_Move_Point" inside a loop. However, it keeps telling me "expected an endloop" when I try to enable the trigger. Can someone please inform me why?
And converted to custom script:

JASS:
function Trig_Attack_Copy_Func004C takes nothing returns boolean
if ( ( UnitHasBuffBJ(GetAttacker(), 'B001') == true ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttacker(), 'B002') == true ) ) then
return true
endif
if ( ( UnitHasBuffBJ(GetAttacker(), 'B000') == true ) ) then
return true
endif
return false
endfunction
function Trig_Attack_Copy_Conditions takes nothing returns boolean
if ( not ( IsUnitType(GetTriggerUnit(), UNIT_TYPE_STRUCTURE) == false ) ) then
return false
endif
if ( not Trig_Attack_Copy_Func004C() ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_Func002Func002C takes nothing returns boolean
if ( not ( udg_Infusion_Attack_Chance <= 100 ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_Func002C takes nothing returns boolean
if ( not ( UnitHasBuffBJ(GetAttacker(), 'B001') == true ) ) then
return false
endif
return true
endfunction
function Trig_Attack_Copy_Actions takes nothing returns nothing
set udg_Infusion_Attack_Chance = GetRandomInt(1, 100)
if ( Trig_Attack_Copy_Func002C() ) then
if ( Trig_Attack_Copy_Func002Func002C() ) then
call SetUnitPathing( GetTriggerUnit(), false )
set bj_forLoopAIndex = 1
set bj_forLoopAIndexEnd = 10
loop
exitwhen bj_forLoopAIndex > bj_forLoopAIndexEnd
local point udg_Infusion_Move_Point
set udg_TempPoint = GetUnitLoc(GetTriggerUnit())
set udg_Infusion_Move_Point = PolarProjectionBJ(udg_TempPoint, 10.00, ( GetUnitFacing(GetTriggerUnit()) - 180.00 ))
call RemoveLocation( udg_TempPoint )
call SetUnitPositionLoc( GetTriggerUnit(), udg_Infusion_Move_Point )
call RemoveLocation( udg_Infusion_Move_Point )
call TriggerSleepAction( 0.01 )
set udg_Infusion_Move_Point = null
set bj_forLoopAIndex = bj_forLoopAIndex + 1
endloop
call SetUnitPathing( GetTriggerUnit(), true )
else
call DoNothing( )
endif
else
call DoNothing( )
endif
endfunction
function InitTrig_Attack_Copy takes nothing returns nothing
set gg_trg_Attack_Copy = CreateTrigger( )
call TriggerRegisterAnyUnitEventBJ( gg_trg_Attack_Copy, EVENT_PLAYER_UNIT_ATTACKED )
call TriggerAddCondition( gg_trg_Attack_Copy, Condition( function Trig_Attack_Copy_Conditions ) )
call TriggerAddAction( gg_trg_Attack_Copy, function Trig_Attack_Copy_Actions )
endfunction