Postado Setembro 26, 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 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 STYLLER OT 2022
Postado Setembro 26, 2019 5 anos Bom dia! A script agora funciona sem erro algum no console, porém não está reconhecendo que quem abriu o portal é o dono. E por isso, da este erro: Obrigado por consertar pra mim
Postado Outubro 1, 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:setAttribute(ITEM_ATTRIBUTE_TEXT, playerId:getParty()) end portal:setAttribute(ITEM_ATTRIBUTE_DESCRIPTION, playerId:getName()) end addEvent(checkPortal, config.portalTime * 1000, uid, pos) end 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:getAttribute(ITEM_ATTRIBUTE_TEXT) local itemDescription = item:getAttribute(ITEM_ATTRIBUTE_DESCRIPTION) if itemParty then local party = player:getParty() if party then if party == itemParty then player:teleportTo(player:getTown():getTemplePosition(), true) return true else player:popupFYI("You do not participate in the portal creator's party.") end end elseif itemDescription then if player:getName() == itemDescription then player:teleportTo(player:getTown():getTemplePosition(), true) else player:popupFYI("You isn't the owner.") return true end end else player:popupFYI("You are PZ locked or in battle.") end end return true end STYLLER OT 2022
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.