Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.79 KB | None | 0 0
  1. tfm.exec.disableAutoNewGame(true)
  2. tfm.exec.disableAutoScore(true)
  3. tfm.exec.disableAutoShaman(true)
  4. tfm.exec.disableAutoTimeLeft(true)
  5. tfm.exec.disableAfkDeath(true)
  6.  
  7. maps = {5077834, 5079033, 6705799, 1200162, 453645, 2024625, 679638, 7015007, 6960893, 6705794, 6877494, 2162591, 2185317, 2333793, 5545395, 5642274, 6449075, 6705720, 6962466, 6940905, 6959036, 6959086, 6959630, 6960415, 6961673, 6963548, 6966613, 6967258, 6974090}
  8.  
  9.  
  10. tfm.exec.newGame(maps[math.random(#maps)])
  11.  
  12.  
  13. function eventPlayerWon(pN)
  14. tfm.exec.newGame(7016471)
  15. tfm.exec.movePlayer(pN, 500, 100)
  16. tfm.exec.setUIMapName("Winner room\n")
  17. end
  18.  
  19. function eventPlayerDied(pN)
  20. tfm.exec.respawnPlayer(pN)
  21. end
  22.  
  23. adminC = {Bendittt = 1}
  24.  
  25. function eventChatCommand(n, c)
  26. if c == "Restart" and adminC[n] then
  27. tfm.exec.newGame(maps[math.random(#maps)])
  28. end
  29. end
  30.  
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77.  
  78.  
  79.  
  80. admin = "INGEN"
  81. adminC = {Bendittt = 1}
  82. cash = {}
  83. item = {}
  84.  
  85. function eventNewPlayer(pN)
  86. item[pN] = 0
  87. ui.addTextArea(1, "<a href = 'event:derollshop'>Shop!</a>", pN, 6, 25, 100, 20, 0x111111, 0x111111, 1, true)
  88. system.bindMouse(pN, true)
  89. if pN == admin then
  90. cash[pN] = 20000
  91. else
  92. cash[pN] = 10 end
  93. ui.addTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  94. end
  95.  
  96. function eventLoop(eT, rT)
  97. for pN in pairs(tfm.get.room.playerList) do
  98. cash[pN] = cash[pN] + 0.2
  99. ui.updateTextArea(2, "You have "..cash[pN].." points", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  100. end
  101. end
  102.  
  103. function eventTextAreaCallback(id, pN, req)
  104. if req == "derollshop" then
  105. ui.addTextArea(1, "<a href = 'event:rollshop'>Shop!</a>\n-> <a href = 'event:plank'>Plank - 20 points</a>\n-> <a href = 'event:frogballoon'>Frog balloon - 60 points</a>\n-> <a href = 'event:RK'>Random Kill - 300 points</a>\n-> <a href = 'event:skip!'>Skip map - 550 points</a>\n-> <a href = 'event:gambling'>Gamble - 225 points</a>\n-> <a href = 'event:triangle'>Cage - 300 points</a>\n-> <a href = 'event:1point'>Points reset - 0 points</a>", pN, 6, 25, 200, 115, 0x003568, 0x38FF00, 1, true)
  106. elseif req == "rollshop" then
  107. ui.addTextArea(1, "<a href = 'event:derollshop'>Shop!</a>", pN, 6, 25, 100, 20, 0x111111, 0x111111, 1, true)
  108.  
  109. elseif req == "plank" then
  110. if cash[pN] >= 10 then
  111. cash[pN] = cash[pN] - 10
  112. item[pN] = 3 -- it's default plank id
  113. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  114. end
  115. elseif req == "frogballoon" then
  116. if cash[pN] >= 60 then
  117. cash[pN] = cash[pN] - 60
  118. item[pN] = 2805
  119. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  120. end
  121. elseif req == "RK" then
  122. if cash[pN] >= 300 then
  123. cash[pN] = cash[pN] - 300
  124. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  125. players = {}
  126. for name,player in pairs(tfm.get.room.playerList) do
  127. table.insert(players,name)
  128. end
  129. tfm.exec.killPlayer(players[math.random(#players)])
  130. end
  131. elseif req == "skip!" then
  132. if cash[pN] >= 550 then
  133. cash[pN] = cash[pN] - 550
  134. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  135. tfm.exec.newGame(maps[math.random(#maps)])
  136. tfm.exec.setUIMapName("BuildRace\n")
  137. end
  138. elseif req == "gambling" then
  139. if cash[pN] >= 225 then
  140. cash[pN] = cash[pN] + (money[math.random(#money)])
  141. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  142. end
  143. elseif req == "triangle" then
  144. if cash[pN] >= 400 then
  145. cash[pN] = cash[pN] - 400
  146. item[pN] = 68
  147. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  148. end
  149. elseif req == "1point" then
  150. if cash[pN] >= -99999999999999999999999999999999999999999999 then
  151. cash[pN] = 1
  152. ui.updateTextArea(2, "You have "..cash[pN].." points!", pN, 625, 25, 170, 20, 0x111111, 0x111111, 1, true)
  153. end
  154. end
  155. end
  156.  
  157.  
  158.  
  159. function eventMouse(pN, x, y)
  160. if item[pN] > 0 then
  161. tfm.exec.addShamanObject(item[pN], x, y, 0, 0, 0, false)
  162. item[pN] = 0
  163. end
  164. end
  165.  
  166. function eventChatCommand(pN, c)
  167. if c == "disable" and adminC[pN] then
  168. system.exit()
  169. end
  170. end
  171.  
  172. for pN in pairs(tfm.get.room.playerList) do
  173. eventNewPlayer(pN)
  174. end
  175.  
  176. function eventPlayerDied2(pN)
  177. tfm.exec.setPlayerScore(pN, cash[pN])
  178. end
  179.  
  180.  
  181. function eventGetCheese(pN)
  182. tfm.exec.setPlayerScore(pN, cash[pN])
  183. end
  184.  
  185. function eventPlayerRespawn(pN)
  186. tfm.exec.setPlayerScore(pN, cash[pN])
  187. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement