Advertisement
Guest User

Caution 1.100

a guest
Jan 24th, 2015
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.19 KB | None | 0 0
  1. data={}
  2. mapas={"5656921","5656978","5657023","4759983","5657689","5613250","5657856","5660156","3830099","5665749","5669319","5669465","1106226","3441279","5682168","3852671","3858131","5683436","5714048","4017512","3783232","5588949"};
  3. cm=os.time();
  4. ma="";
  5.  
  6. function ranking(p)
  7.         local sm = 0;
  8.         for i,v in pairs(data) do
  9.                 if v.points > sm then
  10.                         sm = v.points;
  11.                         ma=i;
  12.                         if ma ~= i then
  13.                                 tfm.exec.setNameColor(ma,0xDC9E0C)
  14.                         end
  15.                 end
  16.         end
  17. end
  18.  
  19. tfm.exec.disableAutoShaman(true)
  20. tfm.exec.disableAutoScore(true)
  21. tfm.exec.disableAutoTimeLeft(true)
  22. tfm.exec.disableAutoNewGame(true)
  23. tfm.exec.newGame(mapas[math.random(#mapas)])
  24.  
  25. function eventNewPlayer(p)
  26.         if not data[p] then
  27.                 nD={
  28.                         ["time"]=os.time();
  29.                         ["points"]=0;
  30.                 };
  31.                 data[p]=nD;
  32.         end
  33.         data[p].time=os.time();
  34.         tfm.exec.bindKeyboard(p,32,false,true)
  35.         tfm.exec.setPlayerScore(p,0,false)
  36. end
  37.  
  38. for i in pairs(tfm.get.room.playerList) do
  39.         tfm.exec.bindKeyboard(i,32,false,true)
  40.         eventNewPlayer(i)
  41. end
  42.  
  43. function eventKeyboard(player,key,down,x,y)
  44.         for i,v in pairs(tfm.get.room.playerList) do
  45.                 if x > v.x - 20 and x < v.x + 20 and y > v.y - 20 and y < v.y + 20 and i ~= player and not tfm.get.room.playerList[player].isDead and not v.isDead and data[player].time < os.time()-1000 and cm < os.time()-16000 then
  46.                         data[player].time=os.time();
  47.                         -- Congelar o jogaodor tfm.exec.addShamanObject(54,v.x,v.y,0,0,false)
  48.                         tfm.exec.killPlayer(i)
  49.                         data[player].points=data[player].points+1;
  50.                         tfm.exec.setPlayerScore(player,1,true)
  51.                 end
  52.         end
  53. end
  54.  
  55. function eventNewGame()
  56. tfm.exec.setGameTime(199)
  57.         cm=os.time();
  58. end
  59.  
  60. function eventLoop(ct,rt)
  61.         local vi = 0;
  62.         local p = "";
  63.         if rt <= 0 then
  64.                 tfm.exec.newGame(mapas[math.random(#mapas)])
  65.         end
  66.         for i,v in pairs(tfm.get.room.playerList) do
  67.                 if not tfm.get.room.playerList[i].isDead then
  68.                         vi=vi+1;
  69.                         p=i;
  70.                 end
  71.         end
  72.         if vi == 1 then
  73.                 vi=1;
  74.                 tfm.exec.giveCheese(p)
  75.                 tfm.exec.playerVictory(p)
  76.                 tfm.exec.setGameTime(6)
  77.         end
  78.         ranking()
  79.         tfm.exec.setNameColor(ma,0xFF1CAE)
  80.         local cores = {"0x000","0xFFF","0xBABD2F","0x00FF7F","0xB22222","0xFFF0F5","FF1CAE","2F7FCC","D2691E"};
  81.         local cor = cores[math.random(#cores)]
  82.         ui.addTextArea(0,"",nil,5,5,790,20,cor,0x000,0.4)
  83. end
  84.  
  85.  
  86. function eventChatCommand(p,cm)
  87.         if cm == "next" then
  88.                 tfm.exec.newGame(mapas[math.random(#mapas)])
  89.         end
  90.         if cm == "ranking" then
  91.                 ranking(p)
  92.         end
  93.         if cm == "hack" then
  94.                 data[p].points=data[p].points+1;
  95.         end
  96. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement