SHOW:
|
|
- or go back to the newest paste.
| 1 | tfm.exec.setGameTime(3,true) | |
| 2 | dp={}
| |
| 3 | roles={0,1}
| |
| 4 | maps={7489629}
| |
| 5 | data={}
| |
| 6 | text={}
| |
| 7 | lang={}
| |
| 8 | players={}
| |
| 9 | ids={
| |
| 10 | 0, | |
| 11 | 0, | |
| 12 | 0, | |
| 13 | 0 | |
| 14 | } | |
| 15 | alive=0 | |
| 16 | lang.en={
| |
| 17 | menu="Menu", | |
| 18 | profile2="Profile", | |
| 19 | help2="Help", | |
| 20 | help="In #kidnapper the goal of the game is for protectors to catch the mouse with the bomb before the mouse gets to the hole. The mouse with the bomb can use attacks to shield off protectors.", | |
| 21 | wins="Total Wins", | |
| 22 | wins_Bomber="Wins As Kidnapper", | |
| 23 | wins_Protector="Wins As Protector", | |
| 24 | close="Close", | |
| 25 | health=100, | |
| 26 | bomber_Wins="Kidnapper Wins!", | |
| 27 | protector_Wins="Protectors Win!", | |
| 28 | powerups2="Powerups", | |
| 29 | powerup1="[Normal Attack]</J> Is activated by pressing space. Only works for Protectors when they are near the bomber.", | |
| 30 | powerup2="[Mega Jump]</J> Is activated by the down arrow.", | |
| 31 | mouseStolen="kidnapped the mouse!", | |
| 32 | buy="Buy", | |
| 33 | bought="Bought", | |
| 34 | shop="Shop", | |
| 35 | points="Points", | |
| 36 | notEnough="Not enough points!" | |
| 37 | } | |
| 38 | for _, s in next, {'AutoTimeLeft', 'PhysicalConsumables', 'AfkDeath', 'AutoShaman', 'AutoNewGame'} do
| |
| 39 | tfm.exec['disable' .. s]() | |
| 40 | end | |
| 41 | function Dp(name) | |
| 42 | name = name:sub(1,1):upper()..name:sub(2):lower() | |
| 43 | for i,dp in ipairs(dp) do | |
| 44 | if name==dp then | |
| 45 | return true | |
| 46 | end | |
| 47 | end | |
| 48 | return false | |
| 49 | end | |
| 50 | function stolen(n) | |
| 51 | data[n].p=player | |
| 52 | data[n].stolen="<R>"..data[n].p.."<J> "..text[n].mouseStolen | |
| 53 | tfm.exec.chatMessage(data[n].stolen,n) | |
| 54 | end | |
| 55 | function particles(x,y) | |
| 56 | tfm.exec.displayParticle(9,x,y+10,-0.4,0.1,0.2,0.3,nil) | |
| 57 | tfm.exec.displayParticle(9,x,y+10,-0.6,0.2,0.6,0.2,nil) | |
| 58 | tfm.exec.displayParticle(9,x,y+10,-0.8,0.3,0.8,0.1,nil) | |
| 59 | tfm.exec.displayParticle(9,x,y+10,0.4,0.4,-0.4,0.3,nil) | |
| 60 | tfm.exec.displayParticle(9,x,y+10,0.6,0.5,-0.6,0.2,nil) | |
| 61 | tfm.exec.displayParticle(9,x,y+10,0.8,0.6,-0.8,0.1,nil) | |
| 62 | end | |
| 63 | function bigJump(n,x,y) | |
| 64 | tfm.exec.movePlayer(n,0,0,false,0,-80,true) | |
| 65 | tfm.exec.displayParticle(3,x-5,y+10,-0.8,0,0,0,n) | |
| 66 | tfm.exec.displayParticle(3,x+5,y+10,0.8,0,0,0,n) | |
| 67 | tfm.exec.displayParticle(3,x-10,y+10,-1.7,0,0,0,n) | |
| 68 | tfm.exec.displayParticle(3,x+10,y+10,1.7,0,0,0,n) | |
| 69 | particles(x,y) | |
| 70 | end | |
| 71 | function identifyBomber(n) | |
| 72 | if data[n].role==0 then | |
| 73 | tfm.exec.setNameColor(n,0x00FF00) | |
| 74 | tfm.exec.movePlayer(n,1023,432,false,0,50,false) | |
| 75 | elseif data[n].role==1 then | |
| 76 | tfm.exec.setNameColor(n,0xFF0000) | |
| 77 | end | |
| 78 | end | |
| 79 | function countAlive() | |
| 80 | alive=0 | |
| 81 | for n,player in pairs(tfm.get.room.playerList) do | |
| 82 | if tfm.get.room.playerList[n].isDead==false then | |
| 83 | alive=alive+1 | |
| 84 | end | |
| 85 | end | |
| 86 | end | |
| 87 | function removeWinner() | |
| 88 | ui.removeTextArea(20,nil) | |
| 89 | ui.removeTextArea(30,nil) | |
| 90 | ui.removeTextArea(40,nil) | |
| 91 | ui.removeTextArea(50,nil) | |
| 92 | ui.removeTextArea(60,nil) | |
| 93 | ui.removeTextArea(19,nil) | |
| 94 | end | |
| 95 | ||
| 96 | function win(n) | |
| 97 | if tfm.get.room.playerList[n].isDead==false and data[n].role==0 then | |
| 98 | data[n].wins=data[n].wins+1 | |
| 99 | data[n].points=data[n].points+7 | |
| 100 | data[n].wins_Protector=data[n].wins_Protector+1 | |
| 101 | end | |
| 102 | end | |
| 103 | function insertName(n) | |
| 104 | table.insert(players,n) | |
| 105 | end | |
| 106 | function setLang(n) | |
| 107 | text[n]=lang[tfm.get.room.playerList[n].community] or lang.en | |
| 108 | end | |
| 109 | function setData(n) | |
| 110 | data[n]= | |
| 111 | {
| |
| 112 | wins=0, | |
| 113 | role=0, | |
| 114 | health=100, | |
| 115 | spawn=1, | |
| 116 | wins_Protector=0, | |
| 117 | wins_Bomber=0, | |
| 118 | p="", | |
| 119 | stolen="", | |
| 120 | shopItems={propellerMouse=0,greenMouse=0,lightningMouse=0,tigerMouse=0},
| |
| 121 | buy1=text[n].buy, | |
| 122 | buy2=text[n].buy, | |
| 123 | buy3=text[n].buy, | |
| 124 | buy4=text[n].buy, | |
| 125 | using="1651b5bc86d.png", | |
| 126 | points=1220 | |
| 127 | } | |
| 128 | end | |
| 129 | function chooseRole() | |
| 130 | for n,player in pairs(tfm.get.room.playerList) do | |
| 131 | data[n].role=0 | |
| 132 | end | |
| 133 | player=players[math.random(#players)] | |
| 134 | data[player].role=1 | |
| 135 | player=""..player | |
| 136 | end | |
| 137 | function bindKeyboard(n) | |
| 138 | for i=0,150 do | |
| 139 | tfm.exec.bindKeyboard(n,i,true,true) | |
| 140 | end | |
| 141 | end | |
| 142 | function showMenu(n) | |
| 143 | ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:menu2'>"..text[n].menu, n, 10, 30, 42, 20, 0x000001, 0xFFFFFF, 1, true) | |
| 144 | end | |
| 145 | function showMenu2(n) | |
| 146 | ui.addTextArea(0, "<p align='center'><font face='calibri'><a href='event:Menu'>"..text[n].menu.." </a>| <a href='event:Help'>"..text[n].help2.."</a> | <a href='event:Profile'>"..text[n].profile2.."</a> | <a href='event:Powerups'>"..text[n].powerups2.."</a> | <a href='event:Shop'>"..text[n].shop, n, 10, 30, 210, 20, 0x000001, 0xffffff, 1, true) | |
| 147 | end | |
| 148 | function removeImage(n) | |
| 149 | tfm.exec.removeImage(id1) | |
| 150 | tfm.exec.removeImage(id2) | |
| 151 | tfm.exec.removeImage(id3) | |
| 152 | tfm.exec.removeImage(id4) | |
| 153 | end | |
| 154 | function removeShop(n) | |
| 155 | for i=1000,10000 do | |
| 156 | ui.removeTextArea(i) | |
| 157 | end | |
| 158 | end | |
| 159 | function showHealth(n) | |
| 160 | ui.addTextArea(-3, "", n, 319, 27, 100, 18, 0xffffff, 0xffffff, 1, true) | |
| 161 | ui.addTextArea(-1, "", n, 319, 27, data[n].health, 18, 0x1aff00, 0x1aff00, 1, true) | |
| 162 | ui.addTextArea(-2, "<p align='center'><b><font color='#000000'>"..data[n].health.."%", n, 345, 27, 54, 18, 0x324650, 0x000000, 0, true) | |
| 163 | end | |
| 164 | function displayTab(n,info,subject) | |
| 165 | ui.addTextArea(2, "", n, 262, 72, 360, 290, 0x331f15, 0x331f15, 1, true) | |
| 166 | ui.addTextArea(3, "", n, 262, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 167 | ui.addTextArea(5, "", n, 295, 72, 290, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 168 | ui.addTextArea(4, "", n, 618, 125, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 169 | ui.addTextArea(6, "", n, 295, 358, 295, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 170 | ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>#KIDNAPPER - "..subject.."</b></font></font><font size='14'>\n\n"..info, n, 271, 80, 342, 270, 0x1b262b, 0x131c21, 1, true) | |
| 171 | ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 339, 20, 0x324650, 0x324650, 1, true) | |
| 172 | end | |
| 173 | function profile(n,info) | |
| 174 | ui.addTextArea(2, "", n, 262, 72, 268, 290, 0x331f15, 0x331f15, 1, true) | |
| 175 | ui.addTextArea(3, "", n, 262, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 176 | ui.addTextArea(5, "", n, 295, 72, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 177 | ui.addTextArea(4, "", n, 526, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 178 | ui.addTextArea(6, "", n, 295, 358, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 179 | ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>"..n.."</b></font></font></p><font size='14'>\n<font face='calibri'>\n"..info, n, 270, 82, 252, 270, 0x1b262b, 0x131c21, 1, true) | |
| 180 | ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 272, 330, 248, 20, 0x324650, 0x324650, 1, true) | |
| 181 | end | |
| 182 | function profile2(n,info,l) | |
| 183 | ui.addTextArea(2, "", l, 262, 72, 268, 290, 0x331f15, 0x331f15, 1, true) | |
| 184 | ui.addTextArea(3, "", l, 262, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 185 | ui.addTextArea(5, "", l, 295, 72, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 186 | ui.addTextArea(4, "", l, 526, 120, 4, 180, 0x6b4231, 0x6b4231, 1, true) | |
| 187 | ui.addTextArea(6, "", l, 295, 358, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 188 | ui.addTextArea(1, "<p align='center'><font face='calibri'><font size='17'><b>"..n.."</b></font></font></p><font size='14'>\n<font face='calibri'>\n"..info, l, 270, 82, 252, 270, 0x1b262b, 0x131c21, 1, true) | |
| 189 | ui.addTextArea(7, "<p align='center'><font size='13'><a href='event:close'>"..text[l].close.."</a></font>", l, 272, 330, 248, 20, 0x324650, 0x324650, 1, true) | |
| 190 | end | |
| 191 | function close(n) | |
| 192 | for i=1,7 do | |
| 193 | ui.removeTextArea(i,n) | |
| 194 | end | |
| 195 | end | |
| 196 | function nearBomber(n,x,y,p) | |
| 197 | if ((tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+100 and tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+50 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-50) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==true then | |
| 198 | tfm.exec.movePlayer(p,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true) | |
| 199 | data[p].health=data[p].health-12.5 | |
| 200 | tfm.exec.displayParticle(1,x,y,0.2,0,0.2,0,nil) | |
| 201 | tfm.exec.displayParticle(1,x,y,0.4,0,0.4,0,nil) | |
| 202 | tfm.exec.displayParticle(1,x,y,0.6,0,0.6,0,nil) | |
| 203 | tfm.exec.displayParticle(1,x,y,0.8,0,0.8,0,nil) | |
| 204 | tfm.exec.displayParticle(1,x,y,1,0,1,0,nil) | |
| 205 | tfm.exec.displayParticle(1,x,y-10,0.2,0,0.2,0,nil) | |
| 206 | tfm.exec.displayParticle(1,x,y-10,0.4,0,0.4,0,nil) | |
| 207 | tfm.exec.displayParticle(1,x,y-10,0.6,0,0.6,0,nil) | |
| 208 | tfm.exec.displayParticle(1,x,y-10,0.8,0,0.8,0,nil) | |
| 209 | tfm.exec.displayParticle(1,x,y-10,1,0,1,0,nil) | |
| 210 | tfm.exec.displayParticle(1,x,y+10,0.2,0,0.2,0,nil) | |
| 211 | tfm.exec.displayParticle(1,x,y+10,0.4,0,0.4,0,nli) | |
| 212 | tfm.exec.displayParticle(1,x,y+10,0.6,0,0.6,0,nil) | |
| 213 | tfm.exec.displayParticle(1,x,y+10,0.8,0,0.8,0,nil) | |
| 214 | tfm.exec.displayParticle(1,x,y+10,1,0,1,0,nil) | |
| 215 | end | |
| 216 | if ((tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-100 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x) and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+50 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-50) and not (n==p) and data[p].health>0 and tfm.get.room.playerList[n].isFacingRight==false then | |
| 217 | tfm.exec.movePlayer(p,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true) | |
| 218 | data[p].health=data[p].health-12.5 | |
| 219 | tfm.exec.displayParticle(1,x,y,-0.2,0,-0.2,0,nil) | |
| 220 | tfm.exec.displayParticle(1,x,y,-0.4,0,-0.4,0,nil) | |
| 221 | tfm.exec.displayParticle(1,x,y,-0.6,0,-0.6,0,nil) | |
| 222 | tfm.exec.displayParticle(1,x,y,-0.8,0,-0.8,0,nil) | |
| 223 | tfm.exec.displayParticle(1,x,y,-1,0,-1,0,nil) | |
| 224 | tfm.exec.displayParticle(1,x,y-10,-0.2,0,-0.2,0,nil) | |
| 225 | tfm.exec.displayParticle(1,x,y-10,-0.4,0,-0.4,0,nil) | |
| 226 | tfm.exec.displayParticle(1,x,y-10,-0.6,0,-0.6,0,nil) | |
| 227 | tfm.exec.displayParticle(1,x,y-10,-0.8,0,-0.8,0,nil) | |
| 228 | tfm.exec.displayParticle(1,x,y-10,-1,0,-1,0,nil) | |
| 229 | tfm.exec.displayParticle(1,x,y+10,-0.2,0,-0.2,0,nil) | |
| 230 | tfm.exec.displayParticle(1,x,y+10,-0.4,0,-0.4,0,nli) | |
| 231 | tfm.exec.displayParticle(1,x,y+10,-0.6,0,-0.6,0,nil) | |
| 232 | tfm.exec.displayParticle(1,x,y+10,-0.8,0,-0.8,0,nil) | |
| 233 | tfm.exec.displayParticle(1,x,y+10,-1,0,-1,0,nil) | |
| 234 | end | |
| 235 | if data[p].health<1 then | |
| 236 | tfm.exec.killPlayer(p) | |
| 237 | end | |
| 238 | end | |
| 239 | operation={-110,110}
| |
| 240 | function nearProtector(n,p,x,y) | |
| 241 | if not (n==p) and data[p].health>0 and data[n].health>0 then | |
| 242 | tfm.exec.displayParticle(13,x,y,-0.2,0.1,-0.2,0.1,nil) | |
| 243 | tfm.exec.displayParticle(13,x,y,-0.4,0,-0.4,0,nil) | |
| 244 | tfm.exec.displayParticle(13,x,y,-0.6,0,-0.6,0,nil) | |
| 245 | tfm.exec.displayParticle(3,x,y,-0.8,0,-0.8,0,nil) | |
| 246 | tfm.exec.displayParticle(3,x,y,-8,0,-1,0,nil) | |
| 247 | tfm.exec.displayParticle(3,x,y-10,-0.2,0.1,-0.2,0.1,nil) | |
| 248 | tfm.exec.displayParticle(13,x,y-10,-0.4,0,-0.4,0,nil) | |
| 249 | tfm.exec.displayParticle(13,x,y-10,-0.6,0,-0.6,0,nil) | |
| 250 | tfm.exec.displayParticle(13,x,y-10,-0.8,0,-0.8,0,nil) | |
| 251 | tfm.exec.displayParticle(13,x,y-10,-1,0,-1,0,nil) | |
| 252 | tfm.exec.displayParticle(13,x,y+10,-0.2,0.1,-0.2,0.1,nil) | |
| 253 | tfm.exec.displayParticle(13,x,y+10,-0.4,0,-0.4,0,nli) | |
| 254 | tfm.exec.displayParticle(13,x,y+10,-0.6,0,-0.6,0,nil) | |
| 255 | tfm.exec.displayParticle(13,x,y+10,-0.8,-0.1,-0.8,-0.1,nil) | |
| 256 | tfm.exec.displayParticle(13,x,y+10,-1,0,-1,0,nil) | |
| 257 | tfm.exec.displayParticle(13,x,y,0.2,0,0.2,0,nil) | |
| 258 | tfm.exec.displayParticle(13,x,y,0.4,0,0.4,0,nil) | |
| 259 | tfm.exec.displayParticle(13,x,y,0.6,0,0.6,0,nil) | |
| 260 | tfm.exec.displayParticle(13,x,y,0.8,0,0.8,0,nil) | |
| 261 | tfm.exec.displayParticle(13,x,y,1,0,1,0,nil) | |
| 262 | tfm.exec.displayParticle(13,x,y-10,0.2,0.1,0.2,0.1,nil) | |
| 263 | tfm.exec.displayParticle(13,x,y-10,0.4,0,0.4,0,nil) | |
| 264 | tfm.exec.displayParticle(13,x,y-10,0.6,0,0.6,0,nil) | |
| 265 | tfm.exec.displayParticle(13,x,y-10,0.8,0,0.8,0,nil) | |
| 266 | tfm.exec.displayParticle(13,x,y-10,1,0,1,0,nil) | |
| 267 | tfm.exec.displayParticle(13,x,y+10,0.2,0,0.2,0,nil) | |
| 268 | tfm.exec.displayParticle(13,x,y+10,0.4,0,0.4,0,nli) | |
| 269 | tfm.exec.displayParticle(13,x,y+10,0.6,0,0.6,0,nil) | |
| 270 | tfm.exec.displayParticle(3,x,y+10,0.8,0,0.8,0,nil) | |
| 271 | tfm.exec.displayParticle(3,x,y+10,8,0,1,0,nil) | |
| 272 | end | |
| 273 | if (tfm.get.room.playerList[n].x<tfm.get.room.playerList[p].x+70 and tfm.get.room.playerList[n].x>tfm.get.room.playerList[p].x-70 and tfm.get.room.playerList[n].y<tfm.get.room.playerList[p].y+30 and tfm.get.room.playerList[n].y>tfm.get.room.playerList[p].y-30) and not (n==p) and data[p].health>0 and data[n].health>0 then | |
| 274 | data[n].health=data[n].health-12.5 | |
| 275 | tfm.exec.movePlayer(n,0,0,false,operation[math.random(#operation)],operation[math.random(#operation)],true) | |
| 276 | end | |
| 277 | if data[n].health<1 then | |
| 278 | tfm.exec.killPlayer(n) | |
| 279 | end | |
| 280 | end | |
| 281 | ||
| 282 | for n,player in pairs(tfm.get.room.playerList) do | |
| 283 | bindKeyboard(n) | |
| 284 | setLang(n) | |
| 285 | insertName(n) | |
| 286 | setData(n) | |
| 287 | showMenu(n) | |
| 288 | table.insert(dp,n) | |
| 289 | end | |
| 290 | chooseRole() | |
| 291 | for n,player in pairs(tfm.get.room.playerList) do | |
| 292 | identifyBomber(n) | |
| 293 | end | |
| 294 | function allInfo(n) | |
| 295 | bindKeyboard(n) | |
| 296 | setLang(n) | |
| 297 | insertName(n) | |
| 298 | setData(n) | |
| 299 | showMenu(n) | |
| 300 | identifyBomber(n) | |
| 301 | table.insert(dp,n) | |
| 302 | end | |
| 303 | function eventNewGame() | |
| 304 | players={}
| |
| 305 | for n,player in pairs(tfm.get.room.playerList) do | |
| 306 | insertName(n) | |
| 307 | end | |
| 308 | chooseRole() | |
| 309 | countAlive() | |
| 310 | removeWinner() | |
| 311 | for n,player in pairs(tfm.get.room.playerList) do | |
| 312 | identifyBomber(n) | |
| 313 | data[n].health=100 | |
| 314 | stolen(n) | |
| 315 | end | |
| 316 | id=tfm.exec.addImage(data[player].using,"$"..player, -40, -25) | |
| 317 | end | |
| 318 | function eventTextAreaCallback(txt, n, a) | |
| 319 | removeImage(n) | |
| 320 | if a=="Menu" then | |
| 321 | showMenu(n) | |
| 322 | elseif a=="menu2" then | |
| 323 | showMenu2(n) | |
| 324 | elseif a=="Help" then | |
| 325 | displayTab(n,text[n].help,text[n].help2) | |
| 326 | elseif a=="close" then | |
| 327 | close(n) | |
| 328 | removeImage(n) | |
| 329 | removeShop(n) | |
| 330 | elseif a=="Profile" then | |
| 331 | profile(n,text[n].wins..": <J>"..data[n].wins.."\n\n</J>"..text[n].wins_Bomber..": <J>"..data[n].wins_Bomber.."\n\n</J>"..text[n].wins_Protector..": <J>"..data[n].wins_Protector.."</J>\n\n"..text[n].points..": <J>"..data[n].points) | |
| 332 | elseif a=="Powerups" then | |
| 333 | displayTab(n,"<J>"..text[n].powerup1.."\n\n<J>"..text[n].powerup2,text[n].powerups2) | |
| 334 | elseif a=="Shop" then | |
| 335 | shop(n) | |
| 336 | elseif a=="buy1" and data[n].points>=80 then | |
| 337 | data[n].buy1="</a><G>"..text[n].bought | |
| 338 | data[n].using="1651ca2b636.png" | |
| 339 | data[n].points=data[n].points-80 | |
| 340 | shop(n) | |
| 341 | elseif a=="buy2" and data[n].points>=150 then | |
| 342 | data[n].buy2="</a><G>"..text[n].bought | |
| 343 | data[n].using="1651ca29934.png" | |
| 344 | data[n].points=data[n].points-150 | |
| 345 | shop(n) | |
| 346 | elseif a=="buy1" and not (data[n].points>=80) then | |
| 347 | tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
| |
| 348 | elseif a=="buy3" and data[n].points>=200 then | |
| 349 | data[n].buy3="</a><G>"..text[n].bought | |
| 350 | data[n].using="1651ca27c02.png" | |
| 351 | data[n].points=data[n].points-200 | |
| 352 | shop(n) | |
| 353 | elseif a=="buy2" and not (data[n].points>=300) then | |
| 354 | tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
| |
| 355 | elseif a=="buy4" and data[n].points>=300 then | |
| 356 | data[n].buy4="</a><G>"..text[n].bought | |
| 357 | data[n].points=data[n].points-300 | |
| 358 | data[n].using="1651ca26129.png" | |
| 359 | shop(n) | |
| 360 | elseif a=="buy3" and not (data[n].points>=200) then | |
| 361 | tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
| |
| 362 | elseif a=="buy4" and not (data[n].points>=150) then | |
| 363 | tfm.exec.chatMessage("<R>"..text[n].notEnough,n)
| |
| 364 | end | |
| 365 | end | |
| 366 | function eventNewPlayer(n) | |
| 367 | allInfo(n) | |
| 368 | end | |
| 369 | function eventLoop(time,timeRemaining) | |
| 370 | for n,player in pairs(tfm.get.room.playerList) do | |
| 371 | data[n].spawn=data[n].spawn+0.5 | |
| 372 | showHealth(n) | |
| 373 | end | |
| 374 | if timeRemaining<=0 then | |
| 375 | tfm.exec.newGame(maps[math.random(#maps)]) | |
| 376 | end | |
| 377 | end | |
| 378 | ||
| 379 | function eventKeyboard(n, k, d, x, y) | |
| 380 | if k==32 and data[n].role==0 and data[n].spawn>0 and tfm.get.room.playerList[n].isDead==false then | |
| 381 | nearBomber(n,x,y,player) | |
| 382 | data[n].spawn=-1 | |
| 383 | elseif k==32 and data[n].role==1 and data[n].spawn>0 and tfm.get.room.playerList[n].isDead==false then | |
| 384 | data[n].spawn=-1.5 | |
| 385 | player=player | |
| 386 | for n in pairs(tfm.get.room.playerList) do | |
| 387 | nearProtector(n,player,tfm.get.room.playerList[player].x,tfm.get.room.playerList[player].y) | |
| 388 | end | |
| 389 | elseif k==3 and data[n].spawn>0 then | |
| 390 | data[n].spawn=-2 | |
| 391 | player=player | |
| 392 | bigJump(n,x,y) | |
| 393 | elseif k==112 then | |
| 394 | ||
| 395 | end | |
| 396 | end | |
| 397 | function eventPlayerDied(n) | |
| 398 | for n,player in pairs(tfm.get.room.playerList) do | |
| 399 | win(n) | |
| 400 | end | |
| 401 | countAlive() | |
| 402 | data[n].health=0 | |
| 403 | if data[n].role==1 then | |
| 404 | for n,player in pairs(tfm.get.room.playerList) do | |
| 405 | ui.addTextArea(20, "", n, 262, 172, 268, 66, 0x331f15, 0x331f15, 1, true) | |
| 406 | ui.addTextArea(30, "", n, 262, 191, 4, 26, 0x6b4231, 0x6b4231, 1, true) | |
| 407 | ui.addTextArea(50, "", n, 300, 172, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 408 | ui.addTextArea(40, "", n, 526, 192, 4, 26, 0x6b4231, 0x6b4231, 1, true) | |
| 409 | ui.addTextArea(60, "", n, 300, 234, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 410 | ui.addTextArea(19, "<p align='center'><font size='20'><VP>"..text[n].protector_Wins, n, 270, 182, 252, 44, 0x1b262b, 0x131c21, 1, true) | |
| 411 | tfm.exec.setGameTime(5,true) | |
| 412 | end | |
| 413 | end | |
| 414 | end | |
| 415 | ||
| 416 | function eventMouse(playerName,x,y) | |
| 417 | print("<VP>X</VP><N>:</N><J> "..x.."</J><VP> Y</VP><N>:</N><J> "..y)
| |
| 418 | end | |
| 419 | system.bindMouse("Fuzzyfirsdog#0000", true)
| |
| 420 | function eventPlayerGetCheese(n) | |
| 421 | if data[n].role==1 then | |
| 422 | data[n].wins=data[n].wins+1 | |
| 423 | data[n].wins_Bomber=data[n].wins_Bomber+1 | |
| 424 | data[n].points=data[n].points+10 | |
| 425 | tfm.exec.setGameTime(10,true) | |
| 426 | for n,player in pairs(tfm.get.room.playerList) do | |
| 427 | ui.addTextArea(20, "", n, 262, 172, 268, 66, 0x331f15, 0x331f15, 1, true) | |
| 428 | ui.addTextArea(30, "", n, 262, 191, 4, 26, 0x6b4231, 0x6b4231, 1, true) | |
| 429 | ui.addTextArea(50, "", n, 300, 172, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 430 | ui.addTextArea(40, "", n, 526, 192, 4, 26, 0x6b4231, 0x6b4231, 1, true) | |
| 431 | ui.addTextArea(60, "", n, 300, 234, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 432 | ui.addTextArea(19, "<p align='center'><font size='20'><R>"..text[n].bomber_Wins, n, 270, 182, 252, 44, 0x1b262b, 0x131c21, 1, true) | |
| 433 | if not (data[n].role==1) then | |
| 434 | tfm.exec.killPlayer(n) | |
| 435 | end | |
| 436 | end | |
| 437 | end | |
| 438 | end | |
| 439 | system.disableChatCommandDisplay("p",true)
| |
| 440 | function eventChatCommand(l,c) | |
| 441 | if c=="p" then | |
| 442 | profile(l,text[l].wins..": <J>"..data[l].wins.."\n\n</J>"..text[l].wins_Bomber..": <J>"..data[l].wins_Bomber.."\n\n</J>"..text[l].wins_Protector..": <J>"..data[l].wins_Protector) | |
| 443 | end | |
| 444 | if c:sub(0,1)=="p" and Dp(c:sub(3))then | |
| 445 | n = c:sub(3,3):upper()..c:sub(4):lower() | |
| 446 | profile2(n,text[l].wins..": <J>"..data[n].wins.."\n\n</J>"..text[l].wins_Bomber..": <J>"..data[n].wins_Bomber.."\n\n</J>"..text[l].wins_Protector..": <J>"..data[n].wins_Protector.."</J>\n\n"..text[l].points..": <J>"..data[n].points,l) | |
| 447 | end | |
| 448 | end | |
| 449 | function shop(n) | |
| 450 | ui.addTextArea(7000, "", n, 113, 58, 643, 260, 0x331f15, 0x331f15, 1, true) | |
| 451 | ui.addTextArea(5000, "", n, 296, 314, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 452 | ui.addTextArea(3000, "", n, 113, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true) | |
| 453 | ui.addTextArea(4000, "", n, 752, 111, 4, 151, 0x6b4231, 0x6b4231, 1, true) | |
| 454 | ui.addTextArea(6000, "", n, 296, 58, 198, 4, 0x6b4231, 0x6b4231, 1, true) | |
| 455 | ui.addTextArea(2000, "<p align='center'><font size='20'><VP>", n, 122, 68, 626, 240, 0x1b262b, 0x131c21, 1, true) | |
| 456 | ui.addTextArea(8000, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/80", n, 154, 94, 100, 100, 0x324650, 0x324650, 1, true) | |
| 457 | ui.addTextArea(9000, "<p align='center'><b><a href='event:buy1'>"..data[n].buy1, n, 153, 238, 100, 23, 0x324650, 0x12191c, 1, true) | |
| 458 | ui.addTextArea(1000, "<p align='center'><b><a href='event:buy2'>"..data[n].buy2, n, 309, 238, 100, 23, 0x324650, 0x12191c, 1, true) | |
| 459 | ui.addTextArea(1100, "<p align='center'><b><a href='event:buy3'>"..data[n].buy3, n, 468, 238, 100, 23, 0x324650, 0x12191c, 1, true) | |
| 460 | ui.addTextArea(1200, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/150", n, 617, 94, 100, 100, 0x324650, 0x324650, 1, true) | |
| 461 | ui.addTextArea(1300, "<p align='center'><b><a href='event:buy4'>"..data[n].buy4, n, 617, 238, 100, 23, 0x324650, 0x12191c, 1, true) | |
| 462 | ui.addTextArea(7700, "<p align='center'><font size='13'><a href='event:close'>"..text[n].close.."</a></font>", n, 125, 285, 620, 20, 0x324650, 0x324650, 1, true) | |
| 463 | ui.addTextArea(9200, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/300", n, 309, 94, 100, 100, 0x324650, 0x324650, 1, true) | |
| 464 | ui.addTextArea(9100, "\n\n\n\n\n\n<p align='center'>"..data[n].points.."/200", n, 468, 94, 100, 100, 0x324650, 0x324650, 1, true) | |
| 465 | id4=tfm.exec.addImage("1651ca2b636.png", "&1", 153, 115, n)
| |
| 466 | id3=tfm.exec.addImage("1651ca29934.png", "&2", 312, 110, n)
| |
| 467 | - | id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 120, n)
|
| 467 | + | |
| 468 | id1=tfm.exec.addImage("1651ca26129.png", "&4", 617, 110, n)
| |
| 469 | end |