Zerveorus

librería LUA

May 21st, 2017
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.91 KB | None | 0 0
  1. tools={
  2.     mic ={
  3.         immobilize = function (name,time,x,y)
  4.                     if tools.room.exist(name) then
  5.                         local time = (time or 3)*1000
  6.                         local x= x or tfm.get.room.playerList[name].x
  7.                         local y=y or tfm.get.room.playerList[name].y
  8.                         tfm.exec.movePlayer(name,x,y)
  9.                             for k = -1,1 do
  10.                             local i,o = -2,2
  11.                                 tfm.exec.addConjuration(x/10+k,y/10+o,time)
  12.                                 tfm.exec.addConjuration(x/10+k,y/10+i,time)
  13.                                 tfm.exec.addConjuration(x/10+o,y/10+k,time)
  14.                                 tfm.exec.addConjuration(x/10+i,y/10+k,time)
  15.                             end
  16.                     end
  17.                     end,
  18.         circle = function(x,y,r)
  19.                 local x,y,a,r = x or 400,y or 200,{11,11,0,2,0,2,0,11,11},r or 100
  20.                     for i=1,10 do
  21.                         local xPos=math.cos(i)*r
  22.                         local yPos=math.sin(i)*r
  23.                         for k=-1,1 do
  24.                             for j=-1,1 do
  25.                                 tfm.exec.displayParticle(a[(i%#a)+1],x+k*xPos,y+j*yPos)
  26.                             end
  27.                         end
  28.                     end
  29.                 end
  30.     },
  31.     config={
  32.         main = function()
  33.             _time = 0
  34.             _mice = {}
  35.             _playersOnRoom = 0
  36.             _textId = 0
  37.             _textData = {}
  38.         end,
  39.         list = function()
  40.             for player in pairs(tfm.get.room.playerList)do
  41.                 _mice[player]={}
  42.                 _playersOnRoom = _playersOnRoom+1
  43.             end
  44.         end,
  45.         loop = function()
  46.             _time = _time +1
  47.             for o,i in pairs(_textData)do
  48.                 if i[3]+i[2] < _time then
  49.                     ui.removeTextArea(i[1])
  50.                 end
  51.             end
  52.         end
  53.     },
  54.     room = {
  55.         exist = function(name)
  56.             tools.config.list()
  57.             if _mice[name] then return true
  58.             else return false
  59.             end
  60.         end,
  61.         players = function()
  62.             tools.config.list()
  63.             return _playersOnRoom
  64.         end
  65.     },
  66.     text = {
  67.         alert = function (text,time,obj,x,y,w,h,fc,bc,t)
  68.             time = time or 5
  69.             obj=obj or nil
  70.             x = x or 300
  71.             y = y or 150
  72.             w = w or 50
  73.             h = h or 50
  74.             fc = fc or 0x324650
  75.             bc = bc or 0x324650
  76.             ui.addTextArea(_textId,text,obj,x,y,w,h,fc,bc,t,true)
  77.             local o = {_textId,time,_time}
  78.             table.insert(_textData,o)
  79.             _textId = _textId +1
  80.         end
  81.     }
  82. }
Advertisement
Add Comment
Please, Sign In to add comment