Postado Dezembro 30, 2016 8 anos 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
Postado Dezembro 31, 2016 8 anos 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 [*Ninguém será digno do sucesso se não usar suas derrotas para conquistá-lo.*] DISCORD: vodkart#6090
Postado Janeiro 1, 2017 8 anos 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 Janeiro 2, 2017 8 anos por Lost666 (veja o histórico de edições)
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.