Function error

Genyuumaru

New Member
Reaction score
15
I created a function to make a unit follow another unit (the default follow follows the unit 300 units away from it).

I created a trigger "Follow Function" and wrote the function there. It looks like this:

JASS:
function Follow takes unit u, unit u2 returns nothing
local location point1 = GetUnitLoc(u)
  call IssuePointOrderLocBJ( u2, "move", point1)
  call SetUnitMoveSpeed( u2, GetUnitMoveSpeed(u)+5)
  set u = null
  set u2 = null
  call RemoveLocation(point1)
endfunction

function InitTrig_Follow_Function takes nothing returns nothing
endfunction


From another trigger I called the function like this:

JASS:
    call TimerStart(t, 0.1 , true, function Follow (GetTriggerUnit(),GetLastCreatedUnit()))


I get an error "Expected a function name" in this line.
Any help?

Also: How to remove all leaks in situations like this one?
 
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