function onRebuildNotifyState(self, msg) local Ape = self:GetParentObj().objIDParent if( Ape == nil or Ape:Exists() == false ) then return end -- a player just did the quickbuild. if (msg.iState == 2) then -- Notify the APE that the build is done and using the player as the sender so we can update missions. Ape:NotifyObject{ ObjIDSender = msg.player, name = "rebuildDone" } self:SetVar("AnchorBreakTime", 3) GAMEOBJ:GetTimer():AddTimerWithCancel( self:GetVar("AnchorBreakTime") , "AnchorBreakTime", self ) end if (msg.iState == 4) then Ape:NotifyObject{ ObjIDSender = self, name = "rebuildCancel" } end end function onDie(self, msg) local Ape = self:GetParentObj().objIDParent if( Ape == nil or Ape:Exists() == false ) then return end Ape:NotifyObject{ ObjIDSender = self, name = "rebuildCancel" } end onTimerDone = function(self, msg) if msg.name == "AnchorBreakTime" then self:Die{} end end