Advertisement
Bolodefchoco_LUAXML

[Script] Shaman Conjuration

Oct 23rd, 2016
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.64 KB | None | 0 0
  1. --Creator: Bolodefchoco
  2. --Made in: 23/10/2016
  3. --Last update: 23/10/2016
  4. --[[ Notes:
  5.     Does:
  6.         Permite que o shaman conjure com as teclas direcionais
  7. ]]--
  8.  
  9. sha = {}
  10.  
  11. oldShaman = nil
  12. _time = 0
  13.  
  14. tfm.exec.disableAutoTimeLeft()
  15. getShaman = function()
  16.     for k,v in next,tfm.get.room.playerList do
  17.         if v.isShaman then
  18.             tfm.exec.killPlayer(k)
  19.             return k
  20.         end
  21.     end
  22. end
  23.  
  24. bind = function(shaman,bol)
  25.     for k,v in next,{0,1,2,3} do
  26.         system.bindKeyboard(shaman,v,true,bol)
  27.     end
  28.     system.bindMouse(shaman,bol)
  29. end
  30.  
  31. eventNewGame = function()
  32.     bind(oldShaman,false)
  33.     local shaman = getShaman()
  34.     bind(shaman,true)
  35.     sha = {
  36.         x = nil,
  37.         y = nil,
  38.         holding = 0,
  39.         spawn = 50,
  40.         count = 0,
  41.     }
  42.     oldShaman = shaman
  43. end
  44.  
  45. eventMouse = function(n,x,y)
  46.     if os.time() > sha.holding then
  47.         sha.holding = os.time() + 1000
  48.         sha.spawn = 50
  49.         sha.count = 0
  50.         sha.x = x
  51.         sha.y = y
  52.         tfm.exec.displayParticle(11,x,y,0,0,0,0,n)
  53.     end
  54. end
  55.  
  56. eventKeyboard = function(n,k)
  57.     if k < 4 and sha.x then
  58.         if sha.holding > os.time() then
  59.             sha.holding = os.time() + 1200
  60.             local i = _time > 60 and 10 or _time > 25 and 20 or 30
  61.             if k%2 == 0 then
  62.                 sha.x = sha.x + (k==0 and -i or i)
  63.             else
  64.                 sha.y = sha.y + (k==1 and -i or i)
  65.             end
  66.             sha.spawn = sha.spawn - 1
  67.             sha.count = sha.count + 1
  68.             tfm.exec.addConjuration(sha.x/10,sha.y/10,15000)
  69.             ui.addTextArea(0,sha.count.."/50",getShaman(),5,30,nil,nil,1,1,0,true)
  70.             if sha.spawn == 0 then
  71.                 sha.x = nil
  72.                 sha.y = nil
  73.                 sha.count = 0
  74.             end
  75.         else
  76.             sha.spawn = 50
  77.             sha.count = 0
  78.         end
  79.     end
  80. end
  81.  
  82. eventLoop = function(t,time)
  83.     _time = time/1000
  84. end
  85.  
  86. tfm.exec.newGame(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement