Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoTimeLeft ( activate )
- players={}
- toDespawn={}
- local infinito = 10
- maps={7675023,521833,401421,541917,541928,541936,541943,527935,559634,559644,888052,878047,885641,770600,770656,772172,891472,589736,589800,589708,900012,901062,754380,901337,901411,907870,910078,1190467,1252043,1124380,1016258,1252299,1255902,1256808,986790,1285380,1271249,1255944,1255983,1085344,1273114,1276664,1279258,1286824,1280135,1280342,1284861,1287556,1057753,1196679,1288489,1292983,1298164,1298521,1293189,1296949,1308378,1311136,1314419,1314982,1318248,1312411,1312589,1312845,1312933,1313969,1338762,1339474,1349878,1297154,644588,1351237,1354040,1354375,1362386,1283234,1370578,1306592,1360889,1362753,1408124,1407949,1407849,1343986,1408028,1441370,1443416,1389255,1427349,1450527,1424739,869836,1459902,1392993,1426457,1542824,1533474,1561467,1563534,1566991,1587241,1416119,1596270,1601580,1525751,1582146,1558167,1420943,1466487,1642575,1648013,1646094,1393097,1643446,1545219,1583484,1613092,1627981,1633374,1633277,1633251,1585138,1624034,1616785,1625916,1667582,1666996,1675013,1675316,1531316,1665413,1681719,1699880,1688696,623770,1727243,1531329,1683915,1689533,1738601,3756146,912118,3326933,3722005,3566478,1456622,1357994,1985670,1884075,1708065,1700322,2124484,3699046,2965313,4057963,4019126,3335202,2050466}
- function eventNewPlayer(name)
- ui . addTextArea ( 991 , "<p align = 'center'> <font size = '15px' color = '# FFD800'>Deatmatch" , nil , 310 , 375 , 175 , 25 , 0x000000 , 0xFFFFFF , 0.5 , true )
- ui.addPopup (1,0,"Bienvenido a <b>Friendly Town</b>. <br><p align='center'><font size='20'><b><font face='Soopafresh'>Ayuda:</font></b><br></font><font size='15'></br> <br><font color='#2019d5'>Este pequeño minijuego esta basado en deatmatch pero modificado , disfrutalo.</br> <br><font><font color='#BABD2F'>Moderadores del juego: Tiburoncin23#9884 y Jitotranss#0000\n</font> <font color='#19d55c'>Codigo lua por Tiburoncin23#9884</br>", name, 250, 130, 270);
- for i,key in ipairs({32,40,83,69}) do
- tfm.exec.bindKeyboard(name,key,true,true)
- end
- players[name]={
- timestamp=os.time(),
- offsets={x=2, y=10},
- score=0
- }
- end
- function eventKeyboard(name,key,down,x,y)
- if (key==32 or key==40 or key==83) and not tfm.get.room.playerList[name].isDead and started then
- if players[name].timestamp < os.time()-1000 then
- local id=tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
- players[name].timestamp=os.time()
- table.insert(toDespawn,{os.time(),id})
- end
- end
- if key==69 then
- if name == "Tiburoncin23#9884" or name == "Jitotranss#0000" then
- tfm.exec.movePlayer(name,0,0,true,0,-50,true)
- end
- end
- end
- function eventPlayerWon(n)
- players[n].score = players[n].score + 1
- ui.addTextArea(2, "<font size='15' face='impact'><p align='center'><G>"..n, nil, 300, 60, 190, 21, 0x324650, 0x000000, 0, true)
- ui.addTextArea(12, "<p align='center'><font size='50' face='impact'><J>RONDAS</J> <S>GANADAS: <vi> "..players[n].score, nil, 150, 10, 501, 83, 0x324650, 0x000000, 0, true)
- ui.addTextArea(993,"<VI>"..n.." <N>¡Ganó el enfrentamiento!",nil,555,330,nil,nil,0x000000 ,0xFFFFFF,0.5,true)
- end
- function eventNewGame()
- started=false
- end
- function eventChatCommand(player, command)
- local args = {}
- for arg in command:gmatch("[^%s]+") do
- table.insert(args, arg)
- end
- if args[1] == "stats" then
- if player == "Tiburoncin23#9884" or player=="Jitotranss#0000" then
- ui.addPopup(0, 0, "Puntos de "..args[2]..": "..players[args[2]].score, player, 24, 213, 169, true)
- end
- elseif args[1] == "!!" then
- local x = tfm.get.room.playerList[player].x
- local y = tfm.get.room.playerList[player].y
- name=player
- for i=0,20 do
- tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
- tfm.exec.addShamanObject(17, x-(tfm.get.room.playerList[name].isFacingRight and players[name].offsets.x or -players[name].offsets.x), y+players[name].offsets.y, tfm.get.room.playerList[name].isFacingRight and 90 or 270)
- end
- end
- end
- function eventLoop(time,remaining)
- if time >= 3000 and not started then
- started=true
- elseif time >= 1000 and not started then
- ui.removeTextArea(993, nil)
- ui.removeTextArea(12,nil)
- ui.removeTextArea(2,nil)
- end
- if remaining<=0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- end
- for i,cannon in ipairs(toDespawn) do
- if cannon[1] <= os.time()-3000 then
- tfm.exec.removeObject(cannon[2])
- table.remove(toDespawn,i)
- end
- end
- for name in pairs(tfm.get.room.playerList) do
- end
- end
- function eventPlayerDied(name)
- ui.removeTextArea(0)
- local i=0
- local n
- for pname,player in pairs(tfm.get.room.playerList) do
- if not player.isDead then
- i=i+1
- n=pname
- end
- end
- if i==0 then
- tfm.exec.newGame(maps[math.random(#maps)])
- elseif i==1 then
- tfm.exec.giveCheese(n)
- tfm.exec.playerVictory(n)
- tfm.exec.setGameTime(5)
- end
- end
- for name,player in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- tfm.exec.newGame(maps[math.random(#maps)])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement