Ir para conteúdo

Featured Replies

Postado

tenho o seguinte script para troca de mapas

preciso adicionar para que quando houver a troca de mapa ignorar o player que esteja em town id "9"


function onThink(interval, lastExecution)

    if string.lower(rotateMaps) ~= "yes" then
        return true
    end

    local players = Game.getPlayers()
    local currentTemple = Game.getStorageValue(currentMap)

    if #players == 0 then
        return true
    end

    if currentTemple == numberOfMaps then
        Game.setStorageValue(currentMap, 1)
        else
        Game.setStorageValue(currentMap, Game.getStorageValue(currentMap) + 1)
    end

    for i = 1, #players do
        local newTemple = Game.getStorageValue(currentMap)
        local pos, player = mapPositions[newTemple]
        player = players[i]
        player:teleportTo(pos)
        player:addHealth(player:getMaxHealth())
        player:addMana(player:getMaxMana())
        local tmp = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_PARALYZE, CONDITION_INVISIBLE, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED, CONDITION_SPELLCOOLDOWN, CONDITION_SPELLGROUPCOOLDOWN}
        for i = 1, #tmp do
            player:removeCondition(tmp[i])
        end
        player:sendTextMessage(MESSAGE_STATUS_WARNING, mapChangeText)
    end

    return true
end

Fanobet_3.jpg

Postado
function onThink(interval, lastExecution)	
	if string.lower(rotateMaps) ~= "yes" then
		return true
	end	
	local players = Game.getPlayers()
	local currentTemple = Game.getStorageValue(currentMap)	
	if #players == 0 then
		return true
	end	
	if currentTemple == numberOfMaps then
		Game.setStorageValue(currentMap, 1)
	else
		Game.setStorageValue(currentMap, Game.getStorageValue(currentMap) + 1)
	end	
	for i = 1, #players do
		local newTemple = Game.getStorageValue(currentMap)
		local pos, player = mapPositions[newTemple], players[i]
		if player:getTown():getId() ~= 9 then
			player:teleportTo(pos)
			player:addHealth(player:getMaxHealth())
			player:addMana(player:getMaxMana())
			local tmp = {CONDITION_POISON, CONDITION_FIRE, CONDITION_ENERGY, CONDITION_BLEEDING, CONDITION_PARALYZE, CONDITION_INVISIBLE, CONDITION_MANASHIELD, CONDITION_INFIGHT, CONDITION_DRUNK, CONDITION_DROWN, CONDITION_ATTRIBUTES, CONDITION_FREEZING, CONDITION_DAZZLED, CONDITION_CURSED, CONDITION_PACIFIED, CONDITION_SPELLCOOLDOWN, CONDITION_SPELLGROUPCOOLDOWN}
			for i = 1, #tmp do
				player:removeCondition(tmp[i])
			end
			player:sendTextMessage(MESSAGE_STATUS_WARNING, mapChangeText)
		end
	end	
	return true
end

 

vodkart_logo.png

[*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*]

 

DISCORDvodkart#6090

 

Postado
  • Autor

@Vodkart    

tive problemas com o setamento da town então tentei mudar para storage alterei a parte da town para essa


     if player:getStorageValue(81262) == 1 then

mas ai o script não teleporta ninguém

com o townid ele teleportava todos, não consegui testar com a town 9 porque sempre que setava outro script resetava para a atual

Editado por Lost666 (veja o histórico de edições)

Fanobet_3.jpg

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo