Advertisement
Guest User

Parkour ~ Black Edition ~ Sebitacapoda

a guest
Jan 13th, 2015
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.15 KB | None | 0 0
  1. -- Rotación de mapas
  2.  
  3.  
  4. local maps = {5735974, 5736012, 5734562}
  5. local currentMap
  6. local playersAlive
  7. tfm.exec.disableAutoShaman(true)
  8.  
  9. function main()
  10. tfm.exec.disableAutoNewGame(true)
  11. startGame()
  12. end
  13.  
  14. function startGame()
  15. local newMap
  16. repeat
  17. newMap = math.random(#maps)
  18. until newMap ~= currentMap
  19. currentMap = newMap
  20. tfm.exec.newGame(maps[newMap])
  21. end
  22.  
  23. function endGame()
  24. startGame()
  25. end
  26.  
  27. function eventNewGame()
  28. tfm.exec.setUIMapName("<font color='#FEAB00'>#Parkour ~ <font color='#000000'>Black <font color='#FEAB00'>Edition")
  29. playersAlive = 0
  30. for _ in pairs(tfm.get.room.playerList) do
  31. playersAlive = playersAlive + 1
  32. end
  33. end
  34.  
  35. function eventPlayerRespawn(name)
  36. playersAlive = playersAlive + 1
  37. end
  38.  
  39. function eventPlayerDied(name)
  40. playersAlive = playersAlive - 1
  41. checkPlayers()
  42. end
  43.  
  44. function eventPlayerWon(name)
  45. playersAlive = playersAlive - 1
  46. checkPlayers()
  47. end
  48.  
  49. function checkPlayers()
  50. if playersAlive == 0 then
  51. endGame()
  52. end
  53. end
  54.  
  55. function eventLoop(t, tr)
  56. if tr <= 0 then
  57. endGame()
  58. end
  59. end
  60.  
  61. function eventLoop(t, tr)
  62. if tr <= 0 then
  63. endGame()
  64. end
  65. end
  66.  
  67. main()
  68.  
  69.  
  70.  
  71. -- Popup's
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79. function eventKeyboard(name, key, down, x,y)
  80. if key==72 then
  81. ui.addPopup(1,0,"<p align='center'><font color='#CCCDCC'>#Parkour ~ Black Edition, Trata de mapas de Parkour, En los cuales tendrás que pasar por obstáculos para llegar a tu casa con tu familia.</p>",name,300,200,200);
  82. elseif key==77 then
  83. ui.addPopup(2,0,"<p align='center'><font color='#CCCDCC'>Si quieres enviar tu mapa, Lo puedes enviar aquí : <font color='#E6FF00'>atelier801.com/topic?f=6&t=789271&p=1#m7</p>",name,300,200,200);
  84. end
  85. end
  86.  
  87.  
  88.  
  89. for name, player in pairs(tfm.get.room.playerList) do
  90. tfm.exec.bindKeyboard(name, 72,false,true)
  91. end
  92.  
  93.  
  94.  
  95.  
  96. for name, player in pairs(tfm.get.room.playerList) do
  97. tfm.exec.bindKeyboard(name, 77,false,true)
  98. end
  99.  
  100.  
  101. -- Color random
  102.  
  103.  
  104.  
  105.  
  106. function randomColor()
  107. return "0x" .. string.format("%X", math.random(0x000000, 0xFFFFFF))
  108. end
  109.  
  110. function eventLoop (currentTime, timeRemaining)
  111. for i=1,100 do
  112. for p,_ in pairs(tfm.get.room.playerList) do
  113. tfm.exec.setNameColor(p, randomColor());
  114. end
  115. end
  116. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement