Advertisement
Saintgio

[Lua][es] Transformice apuntar con el mouse.

Dec 1st, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.68 KB | None | 0 0
  1. local nombre = "Saintgio"
  2.  
  3.  
  4. tfm.exec.position=function(n)
  5.     return tfm.get.room.playerList[n].x,tfm.get.room.playerList[n].y
  6. end
  7.  
  8.  
  9. function eventMouse(n, x_final, y_final)
  10.     local x_inicial, y_inicial = tfm.exec.position(nombre)
  11.     local diferencia_x = x_final - x_inicial
  12.     local diferencia_y = y_final - y_inicial
  13.     local angulo = math.atan2(diferencia_y, diferencia_x)
  14.     angulo = angulo*180/math.pi
  15.     tfm.exec.addShamanObject(0, x_inicial, y_inicial-45, angulo-90)
  16.  
  17.  
  18. end
  19.  
  20.  
  21. function main()
  22.     tfm.exec.disableAutoNewGame(true)
  23.     tfm.exec.disableAutoShaman(true)
  24.     tfm.exec.disableAutoTimeLeft(true)
  25.     tfm.exec.disableAfkDeath(true)
  26.     system.bindMouse(nombre, true)
  27. end
  28.  
  29. main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement