SHARE
TWEET

Untitled

a guest May 19th, 2017 43 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. addEventHandler('onClientResourceStart', resourceRoot,
  2. function()
  3. cube = createObject ( 18095, 5477, -1677, 0, 0, 0, 0 )
  4. outputChatBox ( "The cube will start to move in 30 seconds!")
  5. local txd = engineLoadTXD('cube.txd')
  6. engineImportTXD(txd, 18095)
  7. local col = engineLoadCOL('cube.col')
  8. engineReplaceCOL(col, 18095)
  9. local dff = engineLoadDFF('cube.dff', 0)
  10. engineReplaceModel(dff, 18095)
  11. setTimer ( move, 30000, 1 )
  12. end
  13. )
  14.  
  15. function move ()
  16. local x, y, z = getElementPosition ( cube )
  17. local rotx, roty, rotz = getElementRotation ( cube )
  18. local way1 = { x+30, y, z, rotx, roty+90, rotz }
  19. local way2 = { x, y-30, z, rotx+90, roty, rotz }
  20. local way3 = { x-30, y, z, rotx, roty-90, rotz }
  21. local way4 = { x, y+30, z, rotx-90, roty, rotz }
  22.  
  23. local randomway = math.random(1,4)
  24. moveObject ( cube, 8000, way[randomway][1],way[randomway][2],way[randomway][3],way[randomway][4],way[randomway][5],way[randomway][6])
  25.  
  26. setTimer ( move, 11000, 1 )
  27. end
RAW Paste Data
Top