JO

[Encerrado] como coloco cooldown de 48 horas para os players

Por jofrinho, 05 de abr. de 2018 em Tópicos Sem Resposta

3
902
jofrinhoJ
05 de abril de 2018 às 20:15
local config = {
	requiredLevel = 150,
	daily = true,
	centerRazzagornRoomPosition = Position(33423, 32466, 14),
	playerPositions = {
		Position(33388, 32457, 14),
		Position(33389, 32457, 14),
		Position(33390, 32457, 14),
		Position(33391, 32457, 14),
		Position(33392, 32457, 14)
	},
	newPositions = {
		Position(33417, 32467, 14),
		Position(33417, 32467, 14),
		Position(33417, 32467, 14),
		Position(33417, 32467, 14),
		Position(33417, 32467, 14)
	},
	RazzagornPositions = {
		Position(33425, 32466, 14)
	}
}


function onUse(player, item, fromPosition, target, toPosition, isHotkey, cid, itemEX)
	if item.itemid == 9825 then
		local storePlayers, playerTile = {}

		for i = 1, #config.playerPositions do
			playerTile = Tile(config.playerPositions[i]):getTopCreature()
			if not playerTile or not playerTile:isPlayer() then
				player:sendTextMessage(MESSAGE_STATUS_SMALL, "You need 5 players.")
				return true
			end

			if playerTile:getLevel() < config.requiredLevel then
				player:sendTextMessage(MESSAGE_STATUS_SMALL, "All the players need to be level ".. config.requiredLevel .." or higher.")
				return true
			end

			storePlayers[#storePlayers + 1] = playerTile
		end

		local specs, spec = Game.getSpectators(config.centerRazzagornRoomPosition, false, false, 22, 22, 22, 22)
		for i = 1, #specs do
			spec = specs[i]
			if spec:isPlayer() then
				player:sendTextMessage(MESSAGE_STATUS_SMALL, "A team is already inside the quest room.")
				return true
			end

			spec:remove()
		end

		for i = 1, #config.RazzagornPositions do
			Game.createMonster("Razzagorn", config.RazzagornPositions[i])
		end

		local players
		for i = 1, #storePlayers do
			players = storePlayers[i]
			config.playerPositions[i]:sendMagicEffect(CONST_ME_POFF)
			players:teleportTo(config.newPositions[i])
			config.newPositions[i]:sendMagicEffect(CONST_ME_ENERGYAREA)
			players:setDirection(DIRECTION_EAST)
		end
	elseif item.itemid == 9825 then
		if config.daily then
			player:sendTextMessage(MESSAGE_STATUS_SMALL, Game.getReturnMessage(RETURNVALUE_NOTPOSSIBLE))
			return true
		end
	end

	item:transform(item.itemid == 9826 and 9825 or 9826)
	return true
end

como coloco cooldown de 48horas para os players poderem ir novamente no boss

MarshmelloM
07 de abril de 2018 às 14:12

Seria para 1 player so ou para todos no server

2 meses depois...
StigalS
14 de junho de 2018 às 12:22
A questão neste suporte foi encerrada por falta de respostas. Este tópico está fechado e foi movido para Suporte - Tópicos Sem Resposta.

+ Caso a dúvida não tenha sido resolvida você poderá criar outro tópico solicitando ajuda.
* Lembre-se que é permitido dar UP no tópico a cada 24 horas para assim o destacar e manter movimentado.