Postado Setembro 16, 2019 5 anos Boa tarde nobre sayajin. Ainda sigo com erro. Assim que dei use no item pra abrir o portal, deu este erro: Alguns segundos depois, acredito que após os 30 segundos para o portal sumir, deu este erro também e o portal não sumiu. Obrigado por toda ajuda!
Postado Setembro 20, 2019 5 anos -- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setCustomAttribute("party", playerId:getParty()) else portal:setCustomAttribute("owner", playerId:getName()) end end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getCustomAttribute("party") local itemName = item:getCustomAttribute("name") if itemParty then if player:getParty() == itemParty or then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif itemName then if player:getName() == itemName then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
Postado Setembro 23, 2019 5 anos Bom dia! Deu este erro no distro: Obrigado por todo suporte que vem me dando.
Postado Setembro 24, 2019 5 anos -- Town Portal Scroll System based in Dota 2 local config = { portalId = 11796, -- change to portal item id portalTime = 30, -- portal duration in seconds scrollId = 14324, -- change to scroll item id effect = CONST_ME_POFF -- effect id or CONST that appears at the end of time } local function checkPortal(uid, pos) local position = Position(pos) if position then local tile = Tile(position) if tile then local item = tile:getItemById(config.portalId) if item then item:remove() item:getPosition():sendMagicEffect(config.effect) else local playerId = Player(uid) if playerId then local portal = Game.createItem(config.portalId, 1, position) if portal then if playerId:getParty() then portal:setCustomAttribute("party", playerId:getParty()) else portal:setCustomAttribute("owner", playerId:getName()) end end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end end end end function onUse(player, item, fromPosition, target, toPosition, isHotkey) if item:getId() == config.scrollId then checkPortal(player:getGuid(), player:getPosition()) else if not player:isPzLocked() and not player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then local itemParty = item:getCustomAttribute("party") local itemName = item:getCustomAttribute("name") if itemParty then if player:getParty() == itemParty then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You do not participate in the portal creator's party.") end elseif itemName then if player:getName() == itemName then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") end else player:popupFYI("You isn't the owner.") end else player:popupFYI("You are PZ locked or in battle.") end end return true end
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.