Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local admins = {"Flingoyo", "Drymisty","Quesoyquesos"}
- local banlist = {}
- ui.addPopup (1,0,"Bienvenido a Spiritcheese, minijuego creado por Flingoyo, Drymisty y Quesoyquesos, créditos a Thetroz por su valiosa ayuda. escribe !help para ver una lista de comandos y una pequeña ayuda.", nil, 250, 100, 300);
- for name in pairs (tfm.get.room.playerList) do
- system.bindMouse (name);
- end
- function eventMouse (playerName, x, y)
- tfm.exec.addShamanObject (24, x, y);
- end
- local maps = {"@4580134","@4580165", "@4580177","@4580185","@4580197","@4581571","@4584299", "@4584303","@4584325","@4584326","@4584328","@4584329"}
- function main()
- tfm.exec.disableAutoNewGame (true)
- tfm.exec.disableAutoTimeLeft (true)
- startNewGame();
- end
- function startNewGame()
- tfm.exec.disableAutoShaman(true)
- tfm.exec.newGame (maps[math.random(#maps)]);
- tfm.exec.setGameTime (40);
- tfm.exec.setUIMapName("#Spiritcheese <BV> - @0 <>")
- end
- function eventLoop (a, timeLeft)
- if timeLeft <= 0 then
- startNewGame();
- end
- end
- function eventPlayerDied (playerName)
- local playersAlive = 0;
- local winner;
- for player in pairs(tfm.get.room.playerList) do
- if not tfm.get.room.playerList[player].isDead then
- playersAlive = playersAlive + 1;
- winner = player;
- end
- end
- if (playersAlive ==0) then
- startNewGame();
- end
- end
- main();
- function isBanned (playerName)
- for _,bannedName in pairs(banlist) do
- if playerName == bannedName then return true end
- end
- return false
- end
- function isAdmin (playerName)
- for _,adminName in pairs(admins) do
- if playerName == adminName then return true end
- end
- return false
- end
- function eventChatCommand (playerName, command)
- if isBanned(playerName) then return end
- args = {}
- for arg in command:gmatch ("[^%s]+") do
- table.insert (args, arg)
- end
- if args[1] == "ban" and tfm.get.room.playerList[args[2]] then
- if isAdmin (playerName) then
- if isBanned(args[2]) then
- ui.addPopup (0, 0, "Error: "..args[2].." ya está banead@.", playerName, 350, 200, 100)
- elseif isAdmin(args[2]) then
- ui.addPopup (0, 0, "Error: "..args[2].." es un admin.", playerName, 350, 200, 100)
- else
- table.insert (banlist, args[2])
- tfm.exec.killPlayer(args[2]);
- ui.addPopup (0, 0, "¡Has sido banead@! ", args[2], 350, 200, 100)
- ui.addPopup (1, 0, "¡"..args[2].." ha sido banead@!", playerName, 350, 200, 100)
- end
- else
- ui.addPopup (0, 0, "Error: solo los admins pueden usar este comando", playerName, 350, 200, 100)
- end
- elseif args[1] == "desban" and tfm.get.room.playerList[args[2]] then
- if isAdmin (playerName) then
- if not isBanned(args[2]) then
- ui.addPopup (0, 0, "Error: "..args[2].." no está baneado.", playerName, 350, 200, 100)
- else
- for i,bannedName in pairs(banlist) do
- if args[2] == bannedName then
- table.remove (banlist, i)
- break
- end
- end
- ui.addPopup (0, 0, "¡Has sido desbaneado!", args[2], 350, 200, 100)
- ui.addPopup (1, 0, "¡"..args[2].." ha sido desbaneado! :):)", playerName, 350, 200, 100)
- end
- else
- ui.addPopup (0, 0, "Solo los administradores pueden usar este comando", playerName, 350, 200, 100)
- end
- system.disableChatCommandDisplay("help",true)
- elseif command == "help" then
- ui.addPopup (0,0,"Haz click donde desees invocar una chispa,Si quieres una lista de mapas di !maps , si quieres ponerle color a tu nombre escribe !colores y aparecera una lista de colores", playerName, 200, 100, 400)
- elseif command == "colores" then
- ui.addPopup (0,0,"<b>Colores:</b> !azul , !rojo , !amarillo , !verde , !naranja , !rosa", playerName, 200, 100, 400)
- elseif command == "colores" then
- elseif command == "maps" then
- ui.addPopup (0,0,"<br><p align='center'><font size='20'><b><font face='Soopafresh'>Lista de Mapas:</b><br></font><font size='15'></br> <br><font color='#BABD2F'> @4580134-@4580165-@4580177-@4580185-@4580197-@4581571-@4584299-@4584303-@4584325-@4584326-@4584328-@458432", playerName, 200, 100, 400)
- elseif command == "rojo" then
- tfm.exec.setNameColor(playerName, 0xFF0000)
- elseif command == "azul" then
- tfm.exec.setNameColor(playerName, 0x000AFF)
- elseif command == "verde" then
- tfm.exec.setNameColor(playerName, 0x32FF00)
- elseif command == "rosa" then
- tfm.exec.setNameColor(playerName, 0xFD55FB)
- elseif command == "naranja" then
- tfm.exec.setNameColor(name, 0xFF9500)
- elseif command == "amarillo" then
- tfm.exec.setNameColor(playerName, 0xFFEF00)
- elseif command=="mensaje" then
- ui.addPopup(999,2,"<p align='center'>Escribe tu mensaje en el siguiente cuadro</p>",playerName,300,200,200);
- end
- end
- function eventNewGame (playerName)
- for _,playerName in pairs(banlist) do
- tfm.exec.killPlayer(playerName);
- end
- end
- function eventNewPlayer (playerName)
- if isBanned(playerName) then
- tfm.exec.killPlayer(playerName);
- end
- end
- function eventPlayerRespawn (playerName)
- if isBanned(playerName) then
- tfm.exec.killPlayer(playerName);
- end
- end
- system.disableChatCommandDisplay("mensaje",true)
- function eventPopupAnswer(Id,Name,answer)
- if Id==999 then
- ui.addPopup(0,0,"<font color='#ED67EA'><b>[Equipo de Administracion]</b></font> "..answer.."",p,300,200,150)
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement