Advertisement
Rkubi

Troll face

Apr 7th, 2020
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.11 KB | None | 0 0
  1.   Admin = {"nick"} -- wspisz swój nick tutaj
  2.  
  3.   obj_id = {}
  4.   obj_ilosc = {}
  5.   explosion = {}
  6.   isRemove = true
  7.  
  8.   function test(nick)
  9.      tfm.exec.addImage("1507b1a98c7.png", "%"..nick, -25, -30, nil)
  10.   end
  11.  
  12.   function isAdmin(nick)
  13.        for v, arg in pairs(Admin) do
  14.             if arg == nick then
  15.                return true
  16.             end
  17.        end
  18.   end
  19.  
  20.   function adminsMessage(txt)
  21.        for v, arg in pairs(Admin) do
  22.           tfm.exec.chatMessage(txt, arg)
  23.        end
  24.   end
  25.  
  26.   function eventNewPlayer(nick)
  27.      obj_id[nick] = ""
  28.      obj_ilosc[nick] = ""
  29.      explosion[nick] = {boolean = false, txt = "<R>Wył.</R>"}
  30.         for v, arg in pairs({0,2,68,81}) do
  31.            system.bindKeyboard(nick, arg, true, true)
  32.         end
  33.      system.bindMouse(nick, true)
  34.        if isAdmin(nick) then
  35.           ui.addTextArea(1, "<a href='event:ex'>Eksplozja: "..explosion[nick].txt.."</a>", nick, 700, 380, 90, 20, 0x121212, 0x121212, 1, true)
  36.        end
  37.   end
  38.  
  39.   for nick in pairs(tfm.get.room.playerList) do
  40.      eventNewPlayer(nick)
  41.   end
  42.  
  43.   function eventNewGame()
  44.        for nick in pairs(tfm.get.room.playerList) do
  45.             if isAdmin(nick) then
  46.                test(nick)
  47.             end
  48.        end
  49.   end
  50.  
  51.   function eventPlayerRespawn(nick)
  52.        if isAdmin(nick) then
  53.           test(nick)
  54.        end
  55.   end
  56.  
  57.   function eventChatCommand(nick, cmd)
  58.        if isAdmin(nick) then
  59.        if cmd:sub(1,5) == "balls" and tonumber(cmd:sub(7)) then
  60.             if tonumber(cmd:sub(7)) <= 20 then
  61.                obj_id[nick] = 606
  62.                obj_ilosc[nick] = tonumber(cmd:sub(7))
  63.             end
  64.        elseif cmd:sub(1,6) == "sheeps" and tonumber(cmd:sub(8)) then
  65.             if tonumber(cmd:sub(8)) <= 10 then
  66.                obj_id[nick] = 40
  67.                obj_ilosc[nick] = tonumber(cmd:sub(8))
  68.             end
  69.        elseif cmd:sub(1,9) == "snowballs" and tonumber(cmd:sub(11)) then
  70.             if tonumber(cmd:sub(11)) <= 20 then
  71.                obj_id[nick] = 34
  72.                obj_ilosc[nick] = tonumber(cmd:sub(11))
  73.             end
  74.        elseif cmd:sub(1,6) == "anvils" and tonumber(cmd:sub(8)) then
  75.             if tonumber(cmd:sub(8)) <= 15 then
  76.                obj_id[nick] = 10
  77.                obj_ilosc[nick] = tonumber(cmd:sub(8))
  78.             end
  79.        elseif cmd:sub(1,3) == "ice" and tonumber(cmd:sub(5)) then
  80.             if tonumber(cmd:sub(5)) <= 8 then
  81.                obj_id[nick] = 54
  82.                obj_ilosc[nick] = tonumber(cmd:sub(5))
  83.             end
  84.        elseif cmd:sub(1,1) == "f" then
  85.           tfm.exec.chatMessage("<CE><B>[TROLL]</B> "..cmd:sub(3).."</CE>")
  86.        end
  87.        end
  88.   end
  89.  
  90.   function eventMouse(nick, x, y)
  91.        if isAdmin(nick) then
  92.             if explosion[nick].boolean == true then
  93.                tfm.exec.explosion(x, y, 80, 100, false)
  94.             end
  95.             if obj_id[nick] ~= "" then
  96.                  for v = 1, obj_ilosc[nick] do
  97.                       if obj_id[nick] ~= 34 then
  98.                          tfm.exec.addShamanObject(obj_id[nick], x + math.random(-5,5), y + math.random(-5,5), 0, 0, 0, false)
  99.                       else
  100.                          tfm.exec.addShamanObject(obj_id[nick], x + math.random(-5,5), y + math.random(-5,5), 0, 60, 0, false)
  101.                       end
  102.                  end
  103.               obj_id[nick] = ""
  104.             end
  105.        end
  106.   end
  107.  
  108.   function eventTextAreaCallback(id, nick, odp)
  109.        if odp == "ex" then
  110.             if explosion[nick].boolean == false then
  111.                explosion[nick].txt = "<VP>Wł.</V>"
  112.                explosion[nick].boolean = true
  113.                ui.addTextArea(1, "<a href='event:ex'>Eksplozja: "..explosion[nick].txt.."</a>", nick, 700, 380, 90, 20, 0x121212, 0x121212, 1, true)
  114.             else
  115.                explosion[nick].txt = "<R>Wył.</R>"
  116.                explosion[nick].boolean = false
  117.                ui.addTextArea(1, "<a href='event:ex'>Eksplozja: "..explosion[nick].txt.."</a>", nick, 700, 380, 90, 20, 0x121212, 0x121212, 1, true)
  118.             end
  119.        end
  120.   end
  121.  
  122.   eventNewGame()
  123.   system.disableChatCommandDisplay(nil, true)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement