Stupid Locals

Outbreak191

New Member
Reaction score
17
On this trigger:
Code:
Bubbles Dead
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Set loc = (Position of (Dying unit))
        Unit - Create 1 Bubbles Dead for (Owner of (Dying unit)) at loc facing Default building facing degrees
        Custom script:   set udg_loc = null
        Custom script:   local unit u = GetLastCreatedUnit()
        Wait 1.00 seconds
        Custom script:   call RemoveUnit( u )
        Custom script:   set u = null

I get a compile error from the statement:

Code:
local unit u = GetLastCreatedUnit()

Which I see nothing wrong with. Can anyone help?
 

phyrex1an

Staff Member and irregular helper
Reaction score
447
Declarations of locals has do be in the top of the function.
Code:
Bubbles Dead
    Events
        Unit - A unit Dies
    Conditions
    Actions
        Custom script:   local unit u
        Set loc = (Position of (Dying unit))
        Unit - Create 1 Bubbles Dead for (Owner of (Dying unit)) at loc facing Default building facing degrees
        Custom script:   call RemoveLocation(udg_loc)
        Custom script:   set u = GetLastCreatedUnit()
        Wait 1.00 seconds
        Custom script:   call RemoveUnit( u )
        Custom script:   set u = null
 

emjlr3

Change can be a good thing
Reaction score
395
its never that, more times then not its just user 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