Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local bootcampMaps = {6398045}
- local racingMaps = {6395534, 6384010, 6383942, 6378096, 6372293, 6368140, 6368111, 6365172, 6363386, 6360719, 6360663, 6354900, 6349964, 6349395}
- local normalMaps = {6399152, 6392584, 6384038, 6375526, 6371998, 6368222, 6368059, 6368031, 6363815, 6363607, 6362517, 6360872, 6360773, 6360739, 6360479, 6360252, 6348132}
- local survivorMaps = {6393592, 6366608, 6351808}
- local trollMaps = {6376011}
- local miniGame
- ui.addTextArea(1, "<a href='event:click'>Comandos</a>", nil, 0, 380, 0, 0, 0x1C3C41, 0, 1, true)
- function eventTextAreaCallback(id, name, event)
- if event == "click" then
- ui.addPopup (1, 0, "<font size='20'>Comandos:</font><BR>• <B>!racing</B> Maps Racing.<BR>• <B>!bootcamp</B> Maps Bootcamp<BR>• <B>!normal</B> Maps Normal.<BR>• <B>!exit</B> Para fechar a script.<BR>• <B>!next</B> Para executar o próximo Mapa.<BR>", name, 250, 140, 300, true)
- end
- end
- function eventChatCommand (name, command)
- tfm.exec.disableAutoShaman(true)
- if command == "racing" then
- miniGame = command
- playRacing()
- else if command == "bootcamp" then
- miniGame = command
- playBootcamp()
- else if command == "normal" then
- miniGame = command
- playNormal()
- else if command == "survivor" then
- miniGame = command
- playSurvivor()
- else if command == "exit" then
- system.exit()
- else if command == "next" then
- if miniGame == "bootcamp" then
- playBootcamp()
- else if miniGame == "racing" then
- playRacing()
- else if miniGame == "normal" then
- playNormal()
- else if miniGame == "survivor" then
- playSurvivor()
- else if miniGame == "troll" then
- playTroll()
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- end
- function playRacing()
- local newMap
- repeat
- newMap = math.random(#racingMaps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(racingMaps[newMap])
- tfm.exec.setGameTime (60)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAutoTimeLeft()
- end
- function playBootcamp()
- local newMap
- repeat
- newMap = math.random(#bootcampMaps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(bootcampMaps[newMap])
- tfm.exec.setGameTime (300)
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath()
- tfm.exec.disableAutoTimeLeft()
- end
- function playNormal()
- local newMap
- repeat
- newMap = math.random(#normalMaps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(normalMaps[newMap])
- tfm.exec.setGameTime (120)
- tfm.exec.disableAutoTimeLeft()
- end
- function playSurvivor()
- local newMap
- repeat
- newMap = math.random(#survivorMaps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(survivorMaps[newMap])
- tfm.exec.setGameTime (120)
- tfm.exec.disableAutoTimeLeft()
- end
- function playTroll()
- local newMap
- repeat
- newMap = math.random(#survivorMaps)
- until newMap ~= currentMap
- currentMap = newMap
- tfm.exec.newGame(survivorMaps[newMap])
- tfm.exec.setGameTime (120)
- tfm.exec.disableAutoTimeLeft()
- end
- function eventNewGame()
- playersAlive = 0
- for _ in pairs(tfm.get.room.playerList) do
- playersAlive = playersAlive + 1
- end
- end
- function eventPlayerDied (name)
- if miniGame == "bootcamp" then
- tfm.exec.respawnPlayer (name)
- else if miniGame == "racing" then
- playersAlive = playersAlive - 1
- checkPlayers()
- end
- end
- end
- function eventPlayerWon (name)
- if miniGame == "bootcamp" then
- tfm.exec.respawnPlayer (name)
- else if miniGame == "racing" then
- playersAlive = playersAlive - 1
- checkPlayers()
- end
- end
- end
- function checkPlayers()
- if playersAlive == 0 then
- playRacing()
- end
- end
- function eventNewPlayer (name)
- if miniGame == "bootcamp" then
- tfm.exec.respawnPlayer (name)
- end
- end
- function eventLoop(t, tr)
- if tr <= 0 and miniGame == "racing" then
- playRacing()
- else if tr <= 0 and miniGame == "bootcamp" then
- playBootcamp()
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement