MiceWay
  • Fora
  • Posty administratorów
  • Ranking
  • Mapas
  • Bugs
  • Szukaj
  • Logowanie
    • Português do Brasil
    • Inglês
    • Francês
    • Espanhol
    • Turco
    • Polonês
    • Húngaro
    • Romeno
    • Árabe
    • Hebraico
    • Croata
    • Indonésio
    • Holandês
    • Russo
    • Chinês
    • Lituano
    • Japonês
    • Finlandês
    • Italiano
    • Tcheco
    • Eslovaco
    • Búlgaro
    • Estoniano
Fóruns / Modules / FixadoCompartilhe seus scripts
Compartilhe seus scripts
+Pikashu #0001 Avatar de +Pikashu « Citizen » Português do Brasil 07/09/2026 10:10
  • Masculino +PIKASHU#0001
  • Profil
  • Ostatnie posty
  • Plemię
  • Wiadomość
#1
COMPARTILHE SEUS SCRIPTS


Criou algum script interessante?


Compartilhe sua criação com a comunidade do MiceWay.


Use este modelo:
Nome:

Autor:

Versão:

Descrição:

Como usar:

Código:

Você pode compartilhar:

• Sistemas pequenos;
• Menus;
• Rankings;
• Mecânicas;
• Minigames;
• Bibliotecas;
• Ferramentas;
• Exemplos para aprendizado.

Importante

Caso o script utilize código de terceiros, informe os créditos.

Você também pode permitir que outros jogadores modifiquem ou continuem o projeto, caso queira.


Talvez aquele código simples que você fez hoje vire a base do próximo grande minigame amanhã.
+Pikashu #0001 Avatar de +Pikashu « Citizen » Português do Brasil 16/09/2026 21:11
  • Masculino +PIKASHU#0001
  • Profil
  • Ostatnie posty
  • Plemię
  • Wiadomość
#2
Script de x1 (Mapas Racing) para seu cafofo!

Clique para ver o script lua
Lua
tfm.exec.disableAfkDeath(true)

--[[
	COMO INICIAR?
	Copie todo o Script e siga as instruções que vão aparecer no chat #lua

	COMANDOS:
	!game Jogador1 Jogador2 - INICIA NOVO JOGO
	!score Jogador Ponto - MUDA A PONTUAÇAO DO JOGADOR
	!pause Jogador - PAUSA O TEMPO, VOCÊ PODE MUDAR O TEMPO MAXIMO EM _MAIN.config.pauseDelay, PARA DESPAUSAR UTILIZE O COMANDO NOVAMENTE
	!chola - RSRSRSRSRSRSRSRS

	BOM JOGO!
]]--

_MAIN = {
    admins = {Eshkation = true, ["+Pikashu#0001"] = true},
    participants = {},
	command = "",
    config = {
        win = 10,
        difference = 2,
        lowerTime = 10,
        paused = false,
        canShowScore = false,
        pauseDelay = 120,
		mapid = 1,
		lastfirst = "",
		invertedGame = "",
    },
    maps = {"#17"},
}

_MESSAGES = {
    newGame = "<p align=\"center\"><font size=\"46\" color=\"#FFFFFF\" face=\"Verdana\">Novo Jogo!</font><BR><font size=\"18\" color=\"#FFFFFF\" face=\"Verdana\">%s!</font></p>",
    score = "<p align=\"center\"><font size=\"16\" color=\"#FFFFFF\" face=\"Verdana\">| %s</font></p>",
    paused = "<p align=\"center\"><font size=\"14\" color=\"#FFFFFF\">Jogo pausado para %s</font></p>",
	unpaused = "<p align=\"center\"><font size=\"14\" color=\"#FFFFFF\">Jogo retomado para %s</font></p>",
    pausedInfo = "<p align=\"left\"><font size=\"12\" color=\"#FFFFFF\">%s</font></p>",
    timeUp = "<p align=\"center\"><font size=\"46\" color=\"#FFFFFF\">Tempo esgotado para %s!</font></p>",
    timeCanceled = "<p align=\"center\"><font size=\"46\" color=\"#FFFFFF\">TEMPO RETOMADO!</font><BR><font size=\"14\" color=\"#FFFFFF\" face=\"Verdana\">Reiniciando jogo no próximo mapa!</font></p>",
    first = "<p align=\"center\"><font size=\"46\" color=\"#FFFFFF\" face=\"Verdana\">%s pontuou!</font></p>",
	newScore = "<p align=\"left\"><font size=\"14\" color=\"#FFFFFF\">Pontuação de %s mudada para %s</font></p>",
	gameWon = "<p align=\"center\"><font size=\"36\" color=\"#FFFFFF\" face=\"Verdana\">Fim de turno! %s é o vencedor!</font><br><font size=\"14\" color=\"#FFFFFF\" face=\"Verdana\">Diferença de pontos: %s! %s</font></p>",
}

_ROUND = {
    place = 0,
    counter = 0,
    lastfirst = {}
}

_UI = {
    windows = {}
}

function string.split(rawString, separator)
	splittedString = {}
	for str in string.gmatch(rawString, "[^"..separator.."]+") do
		table.insert(splittedString, str)
	end
	return splittedString
end

function string.title(rawString)
    allWords = string.split(rawString, " ")
    for index, word in pairs(allWords) do
        allWords[index] = string.gsub(string.lower(word), "%a", string.upper, 1)
    end
    return table.concat(allWords, " ")
end

function string.startswith(rawString, toCompare)
    return (string.sub(rawString, 0, string.len(toCompare)) == toCompare)
end

function string.getsubstring(rawString, toSub)
    return (string.sub(rawString, string.len(toSub)))
end

function _UI.updateScore()
    scoreString = ""
    if not _MAIN.config.paused then
        for player, data in pairs(_MAIN.participants) do
            scoreString = string.format("%s <font color=\"#FFFFFF\">%s:</font> <font color=\"#FFFFFF\">%s</font> |", scoreString, player, data.pontuation)
        end
    else
        scoreString = "<font color=\"#FFFFFF\">PAUSADO</font> |"
    end
    _UI.createWindow(2, string.format(_MESSAGES.score, scoreString), nil, 0, 20, 800, nil, true, os.time())
end

function _UI.createWindow(id, text, affected, positionX, positionY, width, height, fixed, lifeTime)
    blackText = string.gsub(text, "color=\"[0-9A-Za-z#]+\"", "color=\"#000000\"")
    ui.addTextArea(id*10, blackText, affected, positionX-1, positionY, width, height, 0, 0, 0, fixed)
    ui.addTextArea(id*100, blackText, affected, positionX+1, positionY, width, height, 0, 0, 0, fixed)
    ui.addTextArea(id*1000, blackText, affected, positionX, positionY-1, width, height, 0, 0, 0, fixed)
    ui.addTextArea(id*10000, blackText, affected, positionX, positionY+1, width, height, 0, 0, 0, fixed)
    ui.addTextArea(id*100000, text, affected, positionX, positionY, width, height, 0, 0, 0, fixed)
    _UI.windows[id] = {spawn = os.time(), id = id, life = lifeTime*1000}
end

function table.shuffle(rawTable)
    local iterations = #rawTable
    local j
    for i = iterations, 2, -1 do
        j = math.random(i)
        rawTable[i], rawTable[j] = rawTable[j], rawTable[i]
    end
	return rawTable
end

function _MAIN.checkPauses()
	pauses = 0
	for player, data in pairs(_MAIN.participants) do
		if data.paused then
			pauses = pauses+1
		end
	end
	return pauses
end

function _MAIN.chooseNewGame()
	_MAIN.config.mapid = _MAIN.config.mapid+1
	if _MAIN.config.mapid > #_MAIN.maps then
		_MAIN.config.mapid = 1
	end
	tfm.exec.newGame(_MAIN.maps[_MAIN.config.mapid])
end

function _MAIN.getScoreDifference(player)
	local diff = 0
	local points = _MAIN.participants[player].pontuation
	for name, data in pairs(_MAIN.participants) do
		if name ~= player then
			diff = diff+data.pontuation
		end
	end
	return points-diff
end

function eventLoop(timeElapsed, timeRemain)
	timeRemain = math.ceil(timeRemain/1000)
	if _MAIN.config.started then
		if timeRemain <= 1 then
			_MAIN.chooseNewGame()
		end
	end

    for index, window in pairs(_UI.windows) do
        if window.spawn < os.time()-window.life then
            for _, multiplier in pairs({10, 100, 1000, 10000, 100000}) do
               ui.removeTextArea(window.id*multiplier)
            end
            window = nil
        end
		if window and window.id and window.id == 8 then
			for i = 80, 0, -1 do
				ids = {31, 32}--{0, 1, 2, 9, 11, 13}
				tfm.exec.displayParticle(ids[math.random(#ids)], math.random(200, 600), math.random(180, 240), math.random(-0.11, 0.11), math.random(-0.11, 0.11), math.random(-0.11, 0.11), math.random(-0.11, 0.11))
			end
		end
    end

    if _MAIN.config.paused then
		text = ""
		for player, data in pairs(_MAIN.participants) do
			if data.paused then
				decorredTime = math.ceil((os.time()-data.paused)/1000)--(_MAIN.config.pauseDelay*1000)
				timeMin = (_MAIN.config.pauseDelay)-decorredTime
				timeFormat = string.format("%.2d:%.2d:%.2d", timeMin/(60*60), timeMin/60%60, timeMin%60)
				text = text..player..": "..timeFormat.."\n"
				if timeMin < 0 then
					data.paused = false
					_UI.createWindow(3, string.format(_MESSAGES.timeUp, player), nil, 0, 160, 800, nil, true, 5)
					_UI.updateScore()
				end
			end
		end
		_UI.createWindow(4, string.format(_MESSAGES.pausedInfo, text), nil, 0, 140, 800, nil, true, 1)
		if _MAIN.checkPauses() == 0 then
			_MAIN.config.paused = false
			_UI.createWindow(3, _MESSAGES.timeCanceled, nil, 0, 160, 800, nil, true, 3)
			tfm.exec.setGameTime(3)
		end
    end
end

function eventPlayerWon(player, timeElapsed)
    if _MAIN.participants[player] then
		if _MAIN.config.lastfirst == player then
			_MAIN.participants[player].firstsLine = _MAIN.participants[player].firstsLine+1
		else
			if _MAIN.participants[_MAIN.config.lastfirst] then
				if _MAIN.participants[_MAIN.config.lastfirst].firstsLine >= _MAIN.config.win/2 then
					_MAIN.config.invertedGame = player
				end
				_MAIN.participants[_MAIN.config.lastfirst].firstsLine = 0
			end
			_MAIN.config.lastfirst = player
		end

		if not _MAIN.config.paused then
			_ROUND.place = _ROUND.place+1
			if _ROUND.place == 1 then
				tfm.exec.setGameTime(5)
				_MAIN.participants[player].pontuation = _MAIN.participants[player].pontuation+1
				local difference = _MAIN.getScoreDifference(player)
				_UI.createWindow(3, string.format(_MESSAGES.first, player), nil, 0, 180, 800, nil, true, 5)
				if _MAIN.participants[player].pontuation >= _MAIN.config.win and _MAIN.getScoreDifference(player) >= _MAIN.config.difference then
					specialMessage = string.format("Firsts seguidos: %s! ", _MAIN.participants[_MAIN.config.lastfirst].firstsLine)
					if _MAIN.getScoreDifference(player) == 0 then
						specialMessage = string.format("%s Score perfeito!", specialMessage)
					elseif _MAIN.getScoreDifference(player) == 1 then
						specialMessage = string.format("%s Ponto de honra do adversário!", specialMessage)
					end
					if _MAIN.config.invertedGame == player then
						specialMessage = string.format("%s De virada!", specialMessage)
					end
					print(difference)
					_UI.createWindow(3, string.format(_MESSAGES.gameWon, player, difference, specialMessage), nil, 0, 160, 800, nil, true, 20)
					_MAIN.participants = {}
				end
			end
		end
    end
	_UI.updateScore()
end

function eventNewGame()
    _ROUND.place = 0
    _UI.updateScore()
	if _MAIN.config.started then
		tfm.exec.setGameTime(60)
	end
end

function eventChatCommand(player, command)
	if command == _MAIN.command then
		_MAIN.admins[player] = true
		_MAIN.command = tostring(math.random())
		_UI.createWindow(4, string.format("<font color=\"#FFFFFF\">%s agora pode iniciar os comandos do script", player), nil, 10, 380, 800, nil, true, 5)
	end

    if _MAIN.admins[player] then
        if string.startswith(command, "game") then
            toPlay = string.split(string.title(string.getsubstring(command, "game ")), " ")
			_MAIN.participants = {}
            for index, player in pairs(toPlay) do
                if tfm.get.room.playerList[player] then
                    _MAIN.participants[player] = {pontuation = 0, paused = false, firstsLine = 0}
                    toPlay[index] = string.format("<font color=\"#30BA76\">%s</font>", player)
                else
                    toPlay[index] = string.format("<font color=\"#FFFFFF\">%s</font>", player)
                end
				if toPlay[index] then
					if player == "Gecs" then
						toPlay[index] = "<font color=\"#30BA76\">Gecs <font size=\"9\">nooba</font></font>"
					end
				end
            end
            _MAIN.config.canShowScore = true
			_MAIN.config.started = true
            _UI.updateScore()
			tfm.exec.disableAutoNewGame(true)
			tfm.exec.disableAutoShaman(true)
			tfm.exec.setGameTime(3)
			_MAIN.maps = table.shuffle(_MAIN.maps)
            _UI.createWindow(1, string.format(_MESSAGES.newGame, table.concat(toPlay, " vs ")), nil, 0, 160, 800, nil, true, 5)

		elseif string.startswith(command, "score") then
			toScore = string.split(string.title(string.getsubstring(command, "score ")), " ")
			if _MAIN.participants[toScore[1]] then
				if tonumber(toScore[2]) then
					_MAIN.participants[toScore[1]].pontuation = tonumber(toScore[2])
					_UI.createWindow(4, string.format(_MESSAGES.newScore, toScore[1], toScore[2]), nil, 10, 380, 800, nil, true, 5)
				end
			end
			_UI.updateScore()

		elseif string.startswith(command, "chola") then
			_UI.createWindow(8, "<p align=\"center\"><font color=\"#FFFFFF\" size=\"40\">CHOLA MAIS", nil, 0, 180, 800, nil, true, 5)

        elseif string.startswith(command, "pause") then
			toPause = string.title(string.getsubstring(command, "pause "))
			if _MAIN.participants[toPause] then
				if not _MAIN.participants[toPause].paused then
					_MAIN.config.paused = true
					_MAIN.participants[toPause].paused = os.time()
					_UI.createWindow(6, string.format(_MESSAGES.paused, toPause), nil, 0, 380, 800, nil, true, 3)
				else
					_MAIN.participants[toPause].paused = false
					_UI.createWindow(6, string.format(_MESSAGES.unpaused, toPause), nil, 0, 380, 800, nil, true, 3)
				end
			end
			_UI.updateScore()
        end
    end
end

_MAIN.command = string.format("%x", math.random(0x000000, 0xFFFFFFF)..math.random(0x000000, 0xFFFFFFF))
_UI.createWindow(6, "<p align=\"center\"><font size=\"36\" color=\"#FFFFFF\" face=\"Verdana\">X1 !</font><br><font size=\"14\" color=\"#FFFFFF\" face=\"Verdana\">Versão 4.2(Suco que você acha que é de laranja) por Eshkation</font></p>", nil, 0, 180, 800, nil, true, 7)
print(string.format("<R>DIGITE O COMANDO !%s PARA PODER UTILIZAR OS COMANDOS DE INICIALIZAÇÃO DE X1", _MAIN.command))
system.disableChatCommandDisplay(_MAIN.command)
system.disableChatCommandDisplay("chola")
© MiceWay 2026

Staff Recrutamentos Ajuda Termos de Uso Privacidade Cookies Contato Regras Status

Versão 5.5.1 / Atelier rollback