Advertisement
Guest User

#Speedracing!

a guest
Oct 29th, 2013
275
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.25 KB | None | 0 0
  1. ---------------------By Nicknamepll
  2. --------------Minigame name Speedracing
  3. -------------21.10.13
  4.  
  5. tfm.exec.setNameColor("Nicknamepll", 0xFF1900)
  6.         tfm.exec.setNameColor("Ouake", 0xFF1900)
  7. system.disableChatCommandDisplay("off",true)
  8. system.disableChatCommandDisplay("help",true)
  9. system.disableChatCommandDisplay("pomoc",true)
  10. tfm.exec.disableAutoTimeLeft (true)
  11. tfm.exec.disableAutoShaman(true)
  12.  
  13. function eventNewPlayer(playerName)
  14. tfm.exec.bindKeyboard(playerName,37,true,true)
  15. tfm.exec.bindKeyboard(playerName,39,true,true)
  16. tfm.exec.bindKeyboard(playerName,81,true,true)
  17. tfm.exec.bindKeyboard(playerName,68,true,true)
  18. end
  19.  
  20. for playerName,player in pairs(tfm.get.room.playerList) do
  21. tfm.exec.bindKeyboard(playerName,37,true,true)
  22. tfm.exec.bindKeyboard(playerName,39,true,true)
  23. tfm.exec.bindKeyboard(playerName,65,true,true)
  24. tfm.exec.bindKeyboard(playerName,68,true,true)
  25. end
  26.  
  27.  
  28. function eventKeyboard(playerName,key,down,x,y)
  29. if key==37 or key == 65 then
  30. tfm.exec.movePlayer(playerName, 0, 0, true, -20, 0, true)
  31. elseif key==39 or key==68 then
  32. tfm.exec.movePlayer(playerName, 0, 0, true, 20, 0, true)
  33. end
  34. end
  35.  
  36. function main()
  37.         tfm.exec.disableAutoNewGame (true);
  38.         tfm.exec.disableAutoShaman(true);
  39.         tfm.exec.disableAutoTimeLeft (true);
  40.         tfm.exec.disableAutoScore (true);
  41.         tfm.exec.disableAfkDeath (true);
  42. end
  43.  
  44. function eventNewGame()
  45.         tfm.exec.setUIMapName("<P>Speedracing!</P>")
  46.         tfm.exec.setGameTime(60*1)
  47.         tfm.exec.setUIShamanName ("<L>Miłej zabawy!</L>")
  48. end
  49.  
  50. tfm.exec.disableAutoNewGame(true)
  51. maps={"@2134537", "@333714",  "@333714", "@445219", "@333714", "@445219", "@2546484", "@333714", "@445219", "@2546484", "@406266", "@333714", "@445219", "@2546484", "@406266", "@669031", "@1378209", "@263163", "@798953", "@333714", "@798953", "@333714", "@445219", "@2546484", "@406266", "@669031", "@1378209", "@263163", }
  52. tfm.exec.newGame(maps[math.random(#maps)])
  53.  
  54. function eventLoop(time,remaining)
  55.         if remaining<=0 then
  56.                 tfm.exec.newGame(maps[math.random(#maps)])
  57.         end
  58. end
  59.  
  60. function eventNewPlayer(name)
  61.             tfm.exec.bindKeyboard(name,32,true,true)
  62.         tfm.exec.respawnPlayer(name);
  63.  end
  64.  
  65. function eventPlayerWon(name)
  66. end
  67.  
  68. function eventPlayerDied(name)
  69. end
  70.  
  71.  
  72. for name,player in pairs(tfm.get.room.playerList) do
  73.         system.bindMouse(name, true)
  74. end
  75.  
  76. function eventNewPlayer(name)
  77.             tfm.exec.bindKeyboard(name,32,true,true)
  78.         tfm.exec.respawnPlayer(name);
  79.          tfm.exec.setUIShamanName("<J>Speed</J>")
  80. end
  81.  
  82. ui.addTextArea(0, "<a href='event:help'>Changelog & Commands</a>", nil, nil, nil, nil, "0x6A7495", "0x6A7495", nil)
  83.  
  84. function eventTextAreaCallback(id,name,cb)
  85.  if cb=='help' then
  86.   ui.addTextArea(1, "<br ><ROSE>CHANGELOG</ROSE><br /><br >Add new map  <ROSE>- V 0.0.2 -</ROSE><br /><br >Add Callback <ROSE>- V 0.0.3 -</ROSE><br >Fixed some bugs <ROSE>- V 0.0.4 -</ROSE><br /><br ><ROSE>COMMANDS<br /></ROSE> - Lista pomocników.<br ><J>'!pomocnicy'</J> - <br /></ROSE><br /></ROSE>Lista testerów.<br /> <br ><J>'!testerzy'</J> - <br /></ROSE>Automatycznie zabija mysz<br /> - <br ><J>'!mort'</J><br /></ROSE></ROSE>\n<br><br><a href='event:close'><VP>Zamknij</VP></a>", name)
  87.  end
  88. if cb=='close' then
  89.   ui.removeTextArea(1, name)
  90.  end
  91. end
  92.  
  93. print '<rose>Version 0.0.4</rose> - <J>Fixed some bugs'
  94. print '<VP> By Nicknamepll'
  95.  
  96.  
  97. function eventChatCommand(playerName, com)
  98.           if com == 'pomocnicy' then
  99.             ui.addPopup(1,0,"Shamousey, Woterek, Szel, Ouake i Tomiek</font>",playerName,175,200,450)
  100.           else if com == 'mort' then
  101.             tfm.exec.killPlayer(playerName)
  102.           else if com == 'testerzy' then
  103.             ui.addPopup(1,0,"Ouake, Szel, Tomiek i Vuouv</font>",playerName,175,200,450)
  104.           else if com == 'off' then
  105.             print("Minigre wyłączył "..nick)
  106.         tfm.exec.disableAutoNewGame(false)
  107.         tfm.exec.disableAutoTimeLeft(false)
  108.         system.disableChatCommandDisplay("testerzy",false)
  109.         system.disableChatCommandDisplay("off",false)
  110.         system.disableChatCommandDisplay("mort",false)
  111.         system.disableChatCommandDisplay("pomocnicy",false)
  112.          system.exit()
  113.       end
  114. end
  115. end
  116. end
  117. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement