Advertisement
TheIncgi

Adjustable Idle script

Jul 11th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.59 KB | None | 0 0
  1. Idle = not Idle
  2. if not Idle then
  3.   return
  4. end
  5.  
  6.  local DISTANCE = 5
  7.  
  8. local px, py, pz = getPlayerPos()
  9.  
  10. local function dist(a, b, x, y)
  11.   local m, n = x-a, y-b
  12.   return math.sqrt( m^2 + n^2 )
  13. end
  14.  
  15. log("&7Idler On")
  16. while Idle do
  17.   right( -1 )
  18.   while Idle do
  19.     local x, y, z = getPlayerPos()
  20.     if dist( px, pz, x, z ) > DISTANCE then
  21.       break
  22.     end
  23.   end
  24.   right( 0 )
  25.   if not Idle then break end
  26.   left( -1 )
  27.   while Idle do
  28.     local x, y, z = getPlayerPos()
  29.     if dist( px, pz, x, z ) < .1 then
  30.       break
  31.     end
  32.   end
  33.   left( 0 )
  34. end
  35. log("&7Idler Off")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement