Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ENT:RunBehaviour()
- while ( true ) do -- Here is the loop, it will run forever
- self:StartActivity( ACT_RUN ) -- Walk animati
- self.loco:SetDesiredSpeed( 80 ) -- Walk speed
- 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 )
- self:StartActivity( ACT_IDLE ) -- Idle animation
- coroutine.wait( 2 ) -- Pause for 2 seconds
- self:StartActivity( ACT_WALK )
- coroutine.yield()
- -- The function is done here, but will start back at the top of the loop and make the bot walk somewhere else
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement