Thetroz

Invocación de objetos a tu alrededor por Musugas

Oct 2nd, 2016
381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.86 KB | None | 0 0
  1. local area = 100
  2. angle = area*area
  3.  
  4.     for name, player in pairs(tfm.get.room.playerList) do
  5.         system.bindMouse(name,true)
  6.     end
  7. a = 0
  8. b = 0
  9.  
  10. function eventMouse(name,x,y)
  11.     local x_mouse = tfm.get.room.playerList[name].x - x
  12.     local y_mouse = tfm.get.room.playerList[name].y - y
  13.     a = x
  14.     b = y
  15.     local distance_to_shaman = x_mouse*x_mouse + y_mouse*y_mouse
  16.     if distance_to_shaman < angle then
  17.         tfm.exec.addShamanObject(2, x, y)
  18.     end
  19. end
  20.  
  21. function eventLoop()
  22. particulaa = {"1"}
  23.     for name, player in pairs(tfm.get.room.playerList) do
  24.         local x, y, r = tfm.get.room.playerList[name].x, tfm.get.room.playerList[name].y, 100
  25.         for i = 1,360 do
  26.             local angle = i * math.pi / 180
  27.             local ptx, pty = x + r * math.cos( angle ), y + r * math.sin( angle )
  28.             tfm.exec.displayParticle(particulaa[math.random(#particulaa)],ptx,pty,0,0,0,0,name)
  29.         end
  30.     end
  31. end
Advertisement
Add Comment
Please, Sign In to add comment