Advertisement
Guest User

Untitled

a guest
Feb 18th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.70 KB | None | 0 0
  1. local spoofArea = {
  2.     fromPosition = Position(31741, 31795, 7),
  3.     toPosition = Position(31881, 31850, 7)
  4. }
  5.  
  6. local function checkSQM()
  7.     local r_x = math.random(spoofArea.fromPosition.x, spoofArea.toPosition.x)
  8.     local r_y = math.random(spoofArea.fromPosition.y, spoofArea.toPosition.y)  
  9.     local r_z = math.random(spoofArea.fromPosition.z, spoofArea.toPosition.z)
  10.     local position = Position(r_x, r_y, r_z)
  11.     if Tile(position):hasFlag(TILESTATE_BLOCKPATH) or Tile(position):hasFlag(TILESTATE_BLOCKSOLID)
  12.     or Tile(position):getTopCreature() then
  13.         return self:checkSQM()
  14.     else
  15.         return position                    
  16.     end        
  17. end
  18.  
  19. -- no código:
  20. local position = checkSQM()
  21. if position then
  22.     player:teleportTo(position)
  23. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement