Advertisement
Guest User

Untitled

a guest
Apr 24th, 2015
194
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.63 KB | None | 0 0
  1. function ENT:RunBehaviour()
  2.  
  3.     while ( true ) do                           -- Here is the loop, it will run forever
  4.  
  5.         self:StartActivity( ACT_RUN )           -- Walk animati    
  6.         self.loco:SetDesiredSpeed( 80 )     -- Walk speed
  7.         self:MoveToPos( self:GetPos() + Vector( math.Rand( -1, 1 ), math.Rand( -1, 1 ), 0 ) * 400 ) -- Walk to a random place within about 400 units ( yielding )
  8.         self:StartActivity( ACT_IDLE )          -- Idle animation
  9.         coroutine.wait( 2 )             -- Pause for 2 seconds
  10.         self:StartActivity( ACT_WALK )
  11.         coroutine.yield()
  12.         -- The function is done here, but will start back at the top of the loop and make the bot walk somewhere else
  13.     end
  14.  
  15. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement