Advertisement
Guest User

Untitled

a guest
Aug 21st, 2014
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.29 KB | None | 0 0
  1. started=true
  2. players={}
  3. jogadores={}
  4. x=690
  5. arg={}
  6. vivo=-2
  7. tfm.exec.disableAfkDeath(true)
  8. tfm.exec.disableAutoShaman(true)
  9. tfm.exec.disableAutoScore(true)
  10. tfm.exec.disableAutoNewGame(true)
  11. system.disableChatCommandDisplay("help")
  12. tfm.exec.newGame("@5363720")
  13. admin={"Haxhhhhhhhhh","Drawist"}
  14. banidos={}
  15. toDespawn={}
  16. function eventNewPlayer(name)
  17.         for i,key in ipairs({32,40,83}) do
  18.                 tfm.exec.bindKeyboard(name,key,true,true)
  19.         end
  20.     end
  21. function eventNewGame()
  22.     tfm.exec.setGameTime(60)
  23.     tfm.exec.setUIMapName("<vp>KillRats versão 1.0")
  24.     for name,player in pairs(tfm.get.room.playerList) do
  25.         table.insert(jogadores,name)
  26.         tfm.exec.setPlayerScore(name,0,false)      
  27.     end
  28.     for _,player in pairs(admin) do
  29.         if player == "Haxhhhhhhhhh" then
  30.             tfm.exec.movePlayer(player,770,100,false,1,1,false)
  31.         elseif player == "Drawist" then
  32.             tfm.exec.movePlayer(player,770,200,false,1,1,false)
  33.         else
  34.             tfm.exec.movePlayer(player,770,300,false,1,1,false)
  35.         end
  36.     end
  37.     for _,player in pairs(players) do
  38.         tfm.exec.movePlayer(player,750,300,false,1,1,false)
  39.     end
  40. end
  41. for name,player in pairs(tfm.get.room.playerList) do        
  42.     players[name]={
  43.    timestamp=os.time(),
  44.    offsets={x=-20, y=10}
  45.    }
  46. end
  47. for name,player in pairs(tfm.get.room.playerList) do
  48.         eventNewPlayer(name)
  49. end
  50. function eventKeyboard(name,key,down,x,y)
  51.         if x >= 660 then
  52.         if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
  53.                 if players[name].timestamp < os.time()-1000 then
  54.                         local id
  55.                         if tfm.get.room.playerList[name].isFacingRight then
  56.                                 id=tfm.exec.addShamanObject(19,x+players[name].offsets.x,y+players[name].offsets.y)
  57.                         else
  58.                                 id=tfm.exec.addShamanObject(20,x+players[name].offsets.x,y+players[name].offsets.y)
  59.                         end
  60.                         players[name].timestamp=os.time()
  61.                         table.insert(toDespawn,{os.time(),id})
  62.          end end end
  63. end
  64. function eventChatCommand(name,command)
  65.             if command == "help" then
  66.             ui.addPopup(0,0,"                  <font size='36'>KillRats           <br><font size='12'>O objetivo do jogo é você não morrer pelos membros que estão no canto! Caso você seja o vencedor, você entra no grupo dos mestres.<br><br>Admins do jogo: Drawist e Haxhhhhhhhhh.",name,350,175,300,true)
  67.         end
  68. end
  69. function eventPlayerDied(name)
  70.     local i=0
  71.     local n
  72.     for pname,player in pairs(tfm.get.room.playerList) do
  73.         if not player.isDead then
  74.             i=i+1
  75.             n=pname
  76.         end
  77.     end
  78.     if i==0 then
  79.         tfm.exec.newGame(maps[math.random(#maps)])
  80.     elseif i==1 then
  81.         for _,player in pairs(jogadores) do
  82.             tfm.exec.giveCheese(n)
  83.             tfm.exec.playerVictory(n)
  84.             table.insert(players,n)
  85.             tfm.exec.movePlayer(n,700,340,false,1,1,false)
  86.         ggg=n; end
  87.     end
  88. end
  89. function coloradmin()
  90.     for _,admins in pairs(admin) do
  91.         tfm.exec.setNameColor(admins, 0x8500FF)
  92.         tfm.exec.bindKeyboard(admins, 32, true, true)
  93.     end
  94. end
  95. function eventLoop(a,b)
  96.     for pn, p in pairs(tfm.get.room.playerList) do
  97.         if p.x >= x + 100 then
  98.             tfm.exec.setNameColor(pn, 0x8500FF)
  99.         end
  100.     end
  101.     if b <= 1 then
  102.         tfm.exec.newGame("@5363720")
  103.     end
  104. end
  105. coloradmin()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement