Boeing747-8

Untitled

Jul 5th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.51 KB | None | 0 0
  1. countdown = 15
  2.  
  3. tfm.exec.setRoomMaxPlayers(10)
  4.  
  5. tfm.exec.disableAutoShaman(true)
  6.  
  7. data={}
  8. r2={}
  9. mice={}
  10. canRank={}
  11.  
  12. function r2:rank(name)
  13. scores = {}
  14. rank = true
  15. txt1=""
  16. txt2=""
  17. table.foreach(data, function(k, v) table.insert(scores,{name=k,score=v.score}) end)
  18. table.sort(scores, function(a, b) return a.score>b.score end)
  19. table.foreachi(scores, function(k, v) if k <= 10 then txt1 = ""..txt1.."<font color='#724C31'><br><V>"..k..") "..v.name..""
  20. txt2 = ""..txt2.."<font color='#724C31'><br><V>"..v.score.."" end end)
  21.  
  22. end
  23.  
  24. function openRank(n)
  25. rank = false
  26. canRank[n]=true
  27.  
  28. ui.addTextArea(-4, "<font face='Comic Sans MS'><font size='14'><b><V><p align='center'>Room Leaderboard<br><J>Winning! "..txt1.."", n, 21, 61, 250, 283, 0x000001, 0xFFFFFF, 0.2, true)
  29.  
  30. ui.addTextArea(-6, "<font face='Comic Sans MS'><p align='center'><font size='14'><p align='center'><b><V>Score<br>"..txt2.."", n, 300, 61, 122, 283, 0x000001, 0xFFFFFF, 0.2, true)
  31. ui.addTextArea(-7, "", n, 20, 367, 254, 23, 0x123e54, 0x123e54, 0.6, true)
  32. ui.addTextArea(-8, "<p align='center'><b><N><a href='event:close'>Close", n, 20, 369, 250, 19, 0x073247, 0x2c555c, 0.2, true)
  33. end
  34.  
  35. function closeRank(n)
  36. for areas, k in pairs({"-1","-2","-3","-4","-5","-6","-7","-8"}) do
  37. ui.removeTextArea(k, n)
  38. end
  39. rank = false
  40. canRank[n]=false
  41. end
  42. function eventLoop(g,l)
  43. rank = false
  44. canRank[n]=true
  45. ui.addTextArea(-4, "<p align='center'><font size='11'><b><J>Room Leaderboard<br>"..txt1.."", n, 91, 61, 100, 283, 0x073247, 0x073247, 0.6, true)
  46.  
  47.  
  48. end
  49.  
  50. for n,player in pairs(tfm.get.room.playerList) do
  51. tfm.exec.bindKeyboard(n,"0",true,true)
  52. tfm.exec.bindKeyboard(n,"1",true,true)
  53. tfm.exec.bindKeyboard(n,"2",true,true)
  54. tfm.exec.bindKeyboard(n,"3",true,true)
  55.  
  56.  
  57. end
  58.  
  59.  
  60.  
  61. tfm.exec.newGame('<C><P DS="m;55,315,175,315,295,315,415,315,535,315" defilante="0,0,30,1" L="4800" /><Z><S><S X="1500" o="324650" L="3000" Y="416" H="69" P="0,0,0.1,0.2,0,0,0,0" T="12" /><S X="3900" o="324650" L="1800" Y="416" H="69" P="0,0,0.3,0.2,0,0,0,0" T="12" /><S X="2" L="22" Y="295" H="241" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="4798" L="32" Y="286" H="250" P="0,0,0,0.2,0,0,0,0" T="1" /></S><D><DS X="400" Y="344" /></D><O /></Z></C>')
  62. tfm.exec.disableAutoNewGame(true)
  63.  
  64. function eventNewPlayer(n)
  65. tfm.exec.chatMessage("<ROSE>Welcome <J>"..n.."<ROSE>!",n)
  66. mice[n] = {score = 0,rank = r2.rank}
  67. data[n]={color=math.random(0xFFFFFF),x=400,y=200,score=0,wins=0,award=""}
  68. ui.addTextArea(-78," ",n,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
  69. mice[n].rank(n)
  70. openRank(n)
  71. tfm.exec.bindKeyboard(n,"0",true,true)
  72. tfm.exec.bindKeyboard(n,"1",true,true)
  73. tfm.exec.bindKeyboard(n,"2",true,true)
  74. tfm.exec.bindKeyboard(n,"3",true,true)
  75.  
  76. ui.addTextArea(-20, "<p align='center'><b><V><a href='event:lb'>Room Leaderboard", n, 700, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  77. ui.addTextArea(-21, "<p align='center'><b><V><a href='event:color'>Change Color", n, 600, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  78. ui.addTextArea(-22, "<p align='center'><b><V><a href='event:help'>Help", n, 500, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  79.  
  80. tfm.exec.respawnPlayer(n)
  81. end
  82. table.foreach(tfm.get.room.playerList,eventNewPlayer)
  83.  
  84. function eventTextAreaCallback(ids,n,cb)
  85. if cb=="close" then
  86. closeRank(n)
  87.  
  88. ui.removeTextArea(-32,n)
  89. ui.removeTextArea(-33,n)
  90. ui.removeTextArea(-34,n)
  91. ui.removeTextArea(-35,n)
  92. ui.removeTextArea(-36,n)
  93. ui.removeTextArea(-37,n)
  94. ui.removeTextArea(-38,n)
  95.  
  96. elseif cb=="lb" then
  97. mice[n].rank(n)
  98. openRank(n)
  99.  
  100.  
  101. elseif cb=="color" then
  102. ui.showColorPicker(0,n,data[n].color,"Choose your color!")
  103.  
  104. elseif cb=="help" then
  105. ui.addTextArea(-1, "", n, 220, 45, 360, 313, 0x123e54, 0x123e54, 1, true)
  106. ui.addTextArea(-32, "", n, 222, 48, 356, 307, 0x042636, 0x042636, 1, true)
  107. ui.addTextArea(-33, "", n, 229, 59, 191, 287, 0x2c555c, 0x2c555c, 1, true)
  108. ui.addTextArea(-34, "<p align='center'><font size='25'><i>#DrawLand</i></b><VP><font size='13'><br><br>In #DrawLand your goal is to try to get to 500 points on the leaderboard, you can get those points from placing more art on the the map, or you can also draw art for just the fun of it. To move you just use normal controls. (WASD or right, left, down, and up keys). The more wins you get, the more prizes you get, explore that for yourself by getting more wins!", n, 231, 61, 187, 283, 0x073247, 0x073247, 1, true)
  109. ui.addTextArea(-35, "", n, 481, 59, 86, 287, 0x2c555c, 0x2c555c, 1, true)
  110. ui.addTextArea(-36, "<p align='center'><N><br><br><br><br><br><font size='10'>Made by Fuzzyfirsdog.<br><br>Credits to Bolodefchoco and Bodykudo for extra coding.", n, 483, 61, 82, 283, 0x073247, 0x073247, 1, true)
  111. ui.addTextArea(-37, "", n, 348, 367, 104, 23, 0x123e54, 0x123e54, 1, true)
  112. ui.addTextArea(-38, "<p align='center'><b><R><a href='event:close'>Close", n, 350, 369, 100, 19, 0x073247, 0x2c555c, 1, true)
  113.  
  114.  
  115. end
  116. end
  117.  
  118. id=0
  119. function eventKeyboard(name,key,down,xPos,yPos)
  120.  
  121. id = id + 1
  122.  
  123.  
  124. if data[name].score == 500 then
  125. data[name].x = 400
  126. data[name].y = 200
  127. countdown = 0
  128.  
  129. data[name].score = 0
  130. data[name].wins = data[name].wins + 1
  131.  
  132.  
  133. tfm.exec.chatMessage("<ROSE>"..name.." has earned 1 win by getting 500 points and now has a total of <J>"..data[name].wins.."<ROSE> wins!")
  134. tfm.exec.chatMessage("<br><VP>New Round Starting in 7 seconds!")
  135. local data = 0
  136.  
  137. elseif key==0 and down then
  138. tfm.exec.setPlayerScore(name,data[name].score)
  139. data[name].x = data[name].x - 22
  140. ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
  141. ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,0xFF7700,0xFF7700,0,false)
  142. data[name].score = data[name].score + 2
  143. mice[name].score = mice[name].score + 2
  144. elseif key==2 and down then
  145. tfm.exec.setPlayerScore(name,data[name].score)
  146. data[name].score = data[name].score + 2
  147. mice[name].score = mice[name].score + 2
  148. ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
  149. data[name].x = data[name].x + 22
  150. ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
  151. elseif key==1 and down then
  152. tfm.exec.setPlayerScore(name,data[name].score)
  153. data[name].score = data[name].score + 2
  154. mice[name].score = mice[name].score + 2
  155. ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
  156. data[name].y = data[name].y - 22
  157. ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
  158. elseif key==3 and down then
  159. data[name].score = data[name].score + 2
  160. mice[name].score = mice[name].score + 2
  161. data[name].y = data[name].y + 22
  162. ui.addTextArea(id,data[name].award,nil,data[name].x,data[name].y,20,20,data[name].color,data[name].color,1,false)
  163. ui.addTextArea(names[math.random(#names)]," <font color='#000001'><font size='10'>"..name.." Wins: "..data[name].wins,nil,data[name].x - 22,data[name].y - 30,200,20,data[name].color,data[name].color,0,false)
  164. tfm.exec.setPlayerScore(name,data[name].score)
  165.  
  166.  
  167.  
  168. end
  169. end
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179. names={"hi xD"}
  180.  
  181.  
  182.  
  183. function eventColorPicked(id,n,col)
  184. if col~=1 then
  185. data[n].color=col
  186. end
  187. end
  188.  
  189. maps={'<C><P DS="m;55,315,175,315,295,315,415,315,535,315" defilante="0,0,30,1" L="4800" /><Z><S><S X="1500" o="324650" L="3000" Y="416" H="69" P="0,0,0.1,0.2,0,0,0,0" T="12" /><S X="3900" o="324650" L="1800" Y="416" H="69" P="0,0,0.3,0.2,0,0,0,0" T="12" /><S X="2" L="22" Y="295" H="241" P="0,0,0,0.2,0,0,0,0" T="1" /><S X="4798" L="32" Y="286" H="250" P="0,0,0,0.2,0,0,0,0" T="1" /></S><D><DS X="400" Y="344" /></D><O /></Z></C>'}
  190.  
  191.  
  192.  
  193. function eventLoop(lx,dx)
  194.  
  195. countdown = countdown + 0.5
  196.  
  197.  
  198.  
  199.  
  200. tfm.exec.setUIMapName("<font color='#009799'>Draw Land!")
  201.  
  202.  
  203.  
  204. for n in next,tfm.get.room.playerList do
  205. if canRank[n] then
  206. mice[n].rank(n)
  207. openRank(n)
  208.  
  209. if countdown == 7 then
  210. tfm.exec.newGame(maps[math.random(#maps)])
  211. tfm.exec.setGameTime("7")
  212.  
  213. if data[n].wins == 5 then
  214. data[n].award = "<font size='17'><J>♣♣"
  215. tfm.exec.chatMessage(n.." has earned a new skin!")
  216.  
  217. elseif data[n].wins == 10 then
  218. data[n].award = "<font size='17'><J>☪"
  219. tfm.exec.chatMessage(n.." has earned a new skin!")
  220.  
  221. elseif data[n].wins == 15 then
  222. data[n].award = "<font size='17'><T>☯"
  223. tfm.exec.chatMessage(n.." has earned a new skin!")
  224.  
  225. elseif data[n].wins == 25 then
  226. data[n].award = "<font size='17'><R>☢"
  227. tfm.exec.chatMessage(n.." has earned a new skin!")
  228.  
  229. elseif data[n].wins == 40 then
  230. data[n].award = "<font size='17'><VP>◘<J>☼"
  231. tfm.exec.chatMessage(n.." has earned a new skin!")
  232.  
  233. elseif data[n].wins == 70 then
  234. data[n].award = "<font size='17'><N>♚"
  235. tfm.exec.chatMessage(n.." has earned a new skin!")
  236.  
  237. elseif data[n].wins == 100 then
  238. data[n].award = "<font size='15'><J>♛"
  239. tfm.exec.chatMessage(n.." has earned a new skin!")
  240.  
  241. elseif dx<=0 then
  242. tfm.exec.newGame(maps[math.random(#maps)])
  243. ui.addTextArea(-80," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
  244.  
  245.  
  246.  
  247.  
  248. end
  249. end
  250. end
  251. end
  252. end
  253.  
  254.  
  255.  
  256.  
  257. ui.addTextArea(-20, "<p align='center'><b><V><a href='event:lb'>Room Leaderboard", n, 700, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  258. ui.addTextArea(-21, "<p align='center'><b><V><a href='event:color'>Change Color", n, 600, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  259. ui.addTextArea(-22, "<p align='center'><b><V><a href='event:help'>Help", n, 500, 369, 90, 39, 0x073247, 0x2c555c, 0.2, true)
  260.  
  261. function eventPlayerDied(m)
  262. tfm.exec.respawnPlayer(m)
  263. end
  264.  
  265. ui.addTextArea(-79," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
  266.  
  267. eventNewGame = function()
  268. ui.addTextArea(-77," ",nil,-500,-500,9000,9000,0xFFFFFF,0xFFFFFF,1,false)
  269. for ic in next,toRemove do
  270. for n,player in pairs(tfm.get.room.playerList) do
  271. data[n].x = 400
  272. data[n].y = 200
  273. ui.removeTextArea(ic)
  274. data[n].score = 0
  275. end
  276. end
  277.  
  278. end
  279.  
  280.  
  281.  
  282. toRemove = {}
  283. do
  284. local addTextArea = ui.addTextArea
  285. ui.addTextArea = function(id,...)
  286. toRemove[id] = true
  287. addTextArea(id,...)
  288. end
  289. end
  290.  
  291.  
  292.  
  293.  
  294.  
  295. tfm.exec.disableAfkDeath(true)
  296.  
  297. for c,player in pairs(tfm.get.room.playerList) do
  298. mice[c].rank(c)
  299. openRank(c)
  300. end
Advertisement
Add Comment
Please, Sign In to add comment