local qbPlayer = '' local qbPlayerStartTime = 1 local startTime = 8 local killTime = 10 local proxRadius = 5 -- Gets everything setup correctly at startup function onStartup(self) end function onRebuildComplete( self, msg ) if ( msg ) then self:SetProximityRadius{radius = proxRadius} qbPlayer = msg.userID:GetID() GAMEOBJ:GetTimer():AddTimerWithCancel(killTime, "KillTimer", self ) self:StopPathing() end end function onProximityUpdate(self, msg) if self:GetVar("qbPlayerRdy") then return end if msg.status == "ENTER" then local target = msg.objId local faction = target:GetFaction() -- If a player collided with me, then do our stuff if faction and faction.faction == 1 and not self:GetVar("qbPlayerRdy") then GAMEOBJ:GetTimer():CancelTimer('KillTimer', self) if target:GetID() == qbPlayer and not self:GetVar("qbPlayerRdy") then --print('player collided') GAMEOBJ:GetTimer():CancelAllTimers(self) self:SetVar("qbPlayerRdy", true) self:StartPathing() elseif not self:GetVar("ElevatorRdy") then GAMEOBJ:GetTimer():AddTimerWithCancel(startTime, "StartElevator", self ) end self:SetVar("ElevatorRdy") end end end -- timers... function onTimerDone(self, msg) if msg.name == "StartElevator" then self:StartPathing() end if msg.name == "KillTimer" then GAMEOBJ:DeleteObject(self) end end