Slowmice

Game with Vampire [RU]

Sep 28th, 2013
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 3.18 KB | None | 0 0
  1. tfm.exec.disableAutoScore(true)
  2. tfm.exec.disableAutoShaman(true)
  3. tfm.exec.disableAutoNewGame(true)
  4. system.disableChatCommandDisplay(true)
  5.  
  6. tfm.exec.setNameColor("Clowfish", 5143)
  7.  
  8. function eventNewGame()
  9.    tfm.exec.setUIMapName("Вампирская")
  10.    tfm.exec.setUIShamanName("Шаман")
  11.    tfm.exec.setGameTime(60)
  12.   end
  13.  
  14. function eventChatCommand(playerName, com)
  15.         if com == 'help' then
  16.                 ui.addPopup(1,0,"<font size='30'color='#14FF00'>Добро пожаловать на игру с вампирами!</font><br />Кто <font size='20'color='#FF0000'>вампир</font>тот может летать<br /><font size='20'color='#14FF00'>.</font>",playerName,100,100,400)
  17.         end
  18.    end
  19.  
  20. local auth = {Arlvaro= true, Othername = true}
  21. function map(player, code)
  22.         if auth[player] then
  23.                 tfm.exec.newGame(code)
  24.         end
  25. end
  26.  
  27. function con (player)
  28.          if com == 'off' then
  29.          elseif auth[player] then
  30.                 system.exit()
  31.         end
  32. end
  33.  
  34. print("<ROSE>by Clowfish")
  35.  
  36. function eventPlayerGetCheese(playerName)
  37.    tfm.exec.setVampirePlayer(playerName)
  38.    ui.addPopup(1,0,"Ты вампир, поймай всех! Летать : SHIFT",playerName,5,25,125)
  39.    end
  40. --Hello
  41.  
  42. function eventNewPlayer(playerName)
  43.    ui.addPopup(1,0,"Hello!",playerName,100,100,125)
  44.    end
  45.  
  46. --Fly
  47.  
  48. function eventNewPlayer(playername)
  49.         for i,key in ipairs({16,69}) do
  50.         tfm.exec.bindKeyboard(playername,key,true,true)
  51.         end
  52. end
  53.  
  54. tfm.exec.newGame(1)
  55.  
  56. maps = {"1", "2", "@57", "@23", "@89", "@37", "@71", "@130", "@59", "@76", "@645288", "@564033", "@238791", "@261959", "30", "@420001", "@164931", "100", "@2960917", "@2971843", "@2975039", "@197442", "@525684", "@2319756", "@301206", "@3605678", "@3008618", "@371072", "@1957536", "@1107804", "@660950", "@3574339", "@1764989", "@3089527", "@520258", "@553000", "@2372033", "@421576", "@304325", "74", "@1222509"}
  57. function eventLoop(t1,t2)
  58. if t2 < 1 then
  59. tfm.exec.newGame(maps[math.random(#maps)])
  60. end
  61.  
  62.  for playerName,player in pairs(tfm.get.room.playerList) do
  63.    if player.isVampire then
  64.  local y = player.y
  65.      local x = player.x
  66.      if x-40 < 100 and x+40 > 100 and y-40 < 100 and y+40 > 100 then
  67.       tfm.exec.setPlayerScore(playerName, 1, true)
  68.       tfm.exec.setGameTime(3,false)
  69.       ui.addPopup(1,0, playerName .." +1 очко!",playerName,100,100,200)
  70.       tfm.exec.killPlayer(playerName)
  71.       tfm.exec.respawnPlayer(playerName)
  72.      end
  73.  end
  74. end
  75. end
  76.  
  77. function eventKeyboard(playername,key,down,x,y)
  78.       if tfm.get.room.playerList[playername].isVampire then
  79.         if key==16 or key==69 then
  80.          tfm.exec.movePlayer(playername,0,0,true,0,-50,true)
  81.         end
  82.       end
  83. end
  84.  
  85. for playername,player in pairs(tfm.get.room.playerList) do
  86.    eventNewPlayer(playername)
  87. end
  88.  
  89. function eventKeyboard(playername,key,down,x,y)
  90.       if tfm.get.room.playerList[playername].isVampire then
  91.         if key==16 or key==69 then
  92.          tfm.exec.movePlayer(playername,0,0,true,0,-50,true)
  93.         end
  94.       end
  95. end
  96.  
  97. for playername,player in pairs(tfm.get.room.playerList) do
  98.    eventNewPlayer(playername)
  99. end
Advertisement
Add Comment
Please, Sign In to add comment