Brenower

[TFM][Brenower] Virar objeto

Jan 14th, 2014
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.25 KB | None | 0 0
  1. -- Virar objetos
  2. -- Créditos:Brenower
  3. -- Tables
  4. data={};
  5. -- Inicio do script
  6. tfm.exec.disableAutoNewGame(true)
  7. tfm.exec.disableAutoShaman(true)
  8. tfm.exec.newGame(0)
  9. for i in pairs(tfm.get.room.playerList) do
  10.     nD={
  11.      ["id"]=id;
  12.     };
  13.     data[i] = nD;
  14.     tfm.exec.bindKeyboard(i,37,true,true)
  15.     tfm.exec.bindKeyboard(i,38,true,true)
  16.     tfm.exec.bindKeyboard(i,39,true,true)
  17.     tfm.exec.bindKeyboard(i,40,true,true)
  18.     id=tfm.exec.addShamanObject(39,tfm.get.room.playerList[i].x,tfm.get.room.playerList[i].y,0,0,0,true)
  19.     data[i].id = id;
  20. end
  21. -- Eventos do teclado
  22. function eventKeyboard(player,key,down,x,y)
  23. local ido = data[player].id
  24. local mo = tfm.exec.moveObject
  25. if key == 37 then
  26. mo(ido,xx,yy,false,-30,0,false)
  27. end
  28. if key == 38 then
  29. mo(ido,xx,yy,false,0,-40,false)
  30. end
  31. if key == 39 then
  32. mo(ido,xx,yy,false,30,0,false)
  33. end
  34. end
  35. -- Loop
  36. function eventLoop()
  37. for i in pairs(tfm.get.room.playerList) do
  38. tfm.exec.displayParticle(2,tfm.get.room.objectList[data[i].id].x,tfm.get.room.objectList[data[i].id].y,0,0,0,0,i)
  39. tfm.exec.displayParticle(1,tfm.get.room.objectList[data[i].id].x-5,tfm.get.room.objectList[data[i].id].y,0,0,0,0,i)
  40. tfm.exec.displayParticle(13,tfm.get.room.objectList[data[i].id].x+5,tfm.get.room.objectList[data[i].id].y,0,0,0,0,i)
  41. end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment