Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admin = { "Tectoon", "Theapps", "Sagazgamer" }
- np= tfm.exec.disableAutoNewGame(true) or {"6417217","6415401","6414946","6414830,"6399152","6398045","6395534","6393592","6392584","6384038","6384010","6383942","6378096","6376011","6375526","6372293","6371998","6368222","6368140","6368111","6368059","6368031","6366608","6365172","6363815","6363607","6363386","6362517","6360872","6360773","6360739","6360719","6360663","6360479","6360252","6354900","6351808","6349964","6349395","6348132","6346991","6346869","6346742","6345470","6344065","6336477","6334798","6333921","6330200","6328559","6328836","6326217","6326606","6325859","6325562","6325211","6325136","6325085","6322362","6322250","6319922","6319728","6319563","6314111","6312154","6312114","6308190","6312087","6310523","6307111","6306640","6304783","6304385","6302959","6297832","6302510","6301908","6298836","6296970","6292887","6290162","6284568","6283405","6161725","6165177","6180458","6196366","6230154","6255153","6257005","6259602","5995085","5995046","5994770","5994649","5994622","5967199","5575612","5918795","5918734","5918730","5918729","5918728","5918714","5918713","5918710","5918709","5918707","5918705","5918704","5918701","5918698","5918694","5918691","5912390","5910657","5908444","5530649","5525574","5506111","5885173","5884932","5499479","5499388","5498342","5494330","5494247","5491284","5491215","5489772","5872118","5870159","5480487","5479269","5474247","5470929","5457988","5457493","5457390","5457222","5457184","5456392","5456192","5456179","5849744","5441190","5441184","5425900","5425772","5425771","5425689","5425674","5425667","5425658","5425648","5425639","5425618","5823509","5415934","5415814","5414578","5800128","5771238","5764777","5726733","5721894","5721064","5720967","5720727","5718523","5703048","5676461","5676150","5674069","5664668","5664429","5640125","5640123","5640121","5640116","5640110","5640108","5640106"}
- function eventLoop(a, b)
- local c= 0;
- table.foreach(tfm.get.room.playerList, function(i,v) c= not v.isDead and c+1 or c end)
- c= (c == 0 or b <=0) and tfm.exec.newGame(np[math.random(#np)]) or nil;
- end
- eventLoop(0, 0)
- mapHistory = { 0 }
- nbMapL = 0
- nbMapH = 0
- parametre = { ["Queijo para todos"] = false, ["Respawn auto"] = false, ["Shaman auto"] = true,
- ["Novo mapa auto"] = true, ["Tempo automático"] = true, ["Pontuação"] = true,
- ["Morte de AFK"] = true,
- ["Todos de Vamp"] = false, ["Meep para todos"] =false, ["Todos Shaman"] = false,
- ["Habilidades"] = true , ["Tempo por partidas"] = 120
- }
- aff = { lJoueurs = {} , joueur = {} , param = {} , param = {}
- }
- joueur = {}
- dernierProfil = {}
- for k, v in pairs (tfm.get.room.playerList) do
- joueur[k] = {}
- end
- for k, pseudo in pairs(admin) do
- ui.addTextArea (3, "<p align='center'><b><a href='event:parametre'>Definições</a></b></p>", pseudo, 10, 30, 80, 20, 0x000000, 0x324650, 0.75, true)
- for l, m in pairs ( aff ) do
- aff[l][pseudo] = false
- end
- end
- function eventTextAreaCallback(id, source, callback)
- if callback == 'parametre' then
- if aff["param"][source] == false then
- affParam( source )
- else
- effParam( source )
- end
- elseif parametre[callback] ~= nil then
- paraGestion(callback, source )
- ui.updateTextArea (id, callback .. ": <a href='event:" .. callback .. "'>" .. B(parametre[callback]) .. "</a>", source )
- end
- end
- function eventPopupAnswer (id, playerName, answer)
- if id == 3 then
- parametre["Tempo por partidas"] = answer
- end
- end
- function affParam(playerName)
- aff["param"][playerName] = true
- if aff["lJoueurs"][playerName] then
- effLJoueurs ( playerName )
- end
- b=0
- for k, v in pairs(parametre) do
- ui.addTextArea (b+2000, k.." : <a href='event:"..k.."'>"..B(v).."</a>" , playerName, 10+185*math.floor(b/6), 65+35*(b % 6), 170, 20, 0x324650, 0x324650, 0.75, true)
- b=b+1
- end
- end
- function effParam(playerName)
- aff["param"][playerName] = false
- for k=b,0,-1 do
- ui.removeTextArea(k+2000, playerName)
- end
- end
- function B(v)
- if type(v) == "boolean" then
- if v==true then
- return "<v><b>true</b></v>"
- else
- return "<r><b>false</b></r>"
- end
- else
- return "<b> "..v.." </b>"
- end
- end
- function paraGestion ( paraModif , playerName)
- if type(parametre[paraModif]) == "boolean" then
- parametre[paraModif] = not parametre[paraModif]
- end
- if paraModif == "Queijo para todos" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.giveCheese ( k )
- end
- elseif paraModif == "Respawn auto" and parametre[paraModif] then
- for k, v in pairs (joueur) do
- tfm.exec.respawnPlayer ( k )
- end
- elseif paraModif == "Shaman auto" then
- tfm.exec.disableAutoShaman( not parametre[paraModif] )
- elseif paraModif == "Novo mapa auto" then
- tfm.exec.disableAutoNewGame ( not parametre[paraModif] )
- elseif paraModif == "Tempo automático" then
- tfm.exec.disableAutoTimeLeft ( not parametre[paraModif] )
- elseif paraModif == "Pontuação" then
- tfm.exec.disableAutoScore ( not parametre[paraModif] )
- elseif paraModif == "Morte de AFK" then
- tfm.exec.disableAfkDeath ( not parametre[paraModif] )
- elseif paraModif == "Tempo por partidas" then
- ui.addPopup (3, 2, "enter default map time", playerName, 200, 200, 150, true)
- elseif paraModif == "Todos de Vamp" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setVampirePlayer ( k )
- end
- elseif paraModif == "Meep para todos" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.giveMeep ( k )
- end
- elseif paraModif == "Todos Shaman" and parametre[paraModif] then
- for k, v in pairs ( joueur ) do
- tfm.exec.setShaman ( k )
- end
- elseif paraModif == "Habilidades" then
- tfm.exec.disableAllShamanSkills ( not parametre[paraModif] )
- end
- end
- function mapGestion (action)
- if action == 'random' then
- nbMapL = math.random(#mapList)
- tfm.exec.newGame(mapList[nbMapL])
- elseif action == 'repeat' then
- tfm.exec.newGame(tfm.get.room.currentMap)
- else
- if action == '-1' and (nbMapL + action) > 0 then
- nbMapL = nbMapL -1
- tfm.exec.newGame ( mapList[nbMapL] )
- elseif action == '+1' and (nbMapL + action) <= #mapList then
- nbMapL = nbMapL + 1
- tfm.exec.newGame ( mapList[nbMapL] )
- end
- end
- end
- function eventNewPlayer ( playerName )
- print ( playerName .. " vient d'entrer dans le salon \o/" )
- joueur[playerName] = {}
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventPlayerLeft ( playerName )
- print ( playerName.. " vient de quitter le salon :(" )
- joueur[playerName] = nil
- end
- function eventPlayerDied ( playerName )
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventPlayerWon ( playerName )
- if parametre["Respawn auto"] then
- tfm.exec.respawnPlayer ( playerName )
- end
- end
- function eventNewGame ()
- if tfm.get.room.currentMap ~= mapHistory[nbMap] then
- nbMapH = nbMapH
- mapHistory[nbMapH] = tfm.get.room.currentMap
- end
- tfm.exec.setGameTime ( parametre["Tempo por partidas"] )
- tfm.exec.setUIMapName("<J>"..tfm.get.room.xmlMapInfo.author.." <N>- <BL>@"..tfm.get.room.xmlMapInfo.mapCode.." <N>- <n>Galeria de Mapas")
- for k, v in pairs ( joueur ) do
- eventPlayerRespawn ( k )
- end
- end
- function eventPlayerRespawn ( playerName )
- if parametre["Queijo para todos"] then
- tfm.exec.giveCheese ( playerName )
- end
- if parametre["Todos Shaman"] then
- tfm.exec.setShaman ( playerName )
- end
- if parametre["Todos de Vamp"] then
- tfm.exec.setVampirePlayer ( playerName )
- end
- if parametre["Meep para todos"] then
- tfm.exec.giveMeep ( playerName )
- end
- end
- function isAdmin ( name )
- for k, v in pairs( admin ) do
- if name == v then
- return true
- end
- end
- return false
- end
- print("<J> Script<ch> ON")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement