Postado Outubro 16, 2017 7 anos Olá Tk, eu gostaria de ajuda para arrumar um script que não esta funcionando muito bem. O Script é esse function onUse(player, item, fromPosition, target, toPosition, isHotkey) local itemId = item:getId() if not player:isPremium() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Only premium players can pass.") return true end if table.contains(horizontalOpenDoors, itemId) or table.contains(verticalOpenDoors, itemId) then local doorCreature = Tile(toPosition):getTopCreature() if doorCreature ~= nil then toPosition.x = toPosition.x + 1 local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING)) if query ~= RETURNVALUE_NOERROR then toPosition.x = toPosition.x - 1 toPosition.y = toPosition.y + 1 query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING)) end if query ~= RETURNVALUE_NOERROR then player:sendTextMessage(MESSAGE_STATUS_SMALL, query) return true end doorCreature:teleportTo(toPosition, true) end if not table.contains(openSpecialDoors, itemId) then item:transform(itemId - 1) end return true else item:transform(itemId + 1) player:teleportTo(toPosition, true) end return true end Actions.xml esta assim. <action uniqueid="9050" script="premiumdoor.lua"/> Isso é como esta a porta. 23:59 You see a gate of expertise for level 60. Item ID: 6265, Action ID: 1060, Unique ID: 9050. Position: 435, 283, 3 Esse erro aparece no console
Postado Outubro 24, 2017 7 anos Solução Spoiler function onUse(player, item, fromPosition, target, toPosition, isHotkey) local itemId = item:getId() if not player:isPremium() then player:sendTextMessage(MESSAGE_STATUS_CONSOLE_ORANGE, "Only premium players can pass.") return true end if isInArray(horizontalOpenDoors, itemId) or isInArray(verticalOpenDoors, itemId) then local doorCreature = Tile(toPosition):getTopCreature() if doorCreature ~= nil then toPosition.x = toPosition.x + 1 local query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING)) if query ~= RETURNVALUE_NOERROR then toPosition.x = toPosition.x - 1 toPosition.y = toPosition.y + 1 query = Tile(toPosition):queryAdd(doorCreature, bit.bor(FLAG_IGNOREBLOCKCREATURE, FLAG_PATHFINDING)) end if query ~= RETURNVALUE_NOERROR then player:sendTextMessage(MESSAGE_STATUS_SMALL, query) return true end doorCreature:teleportTo(toPosition, true) end if not isInArray(openSpecialDoors, itemId) then item:transform(itemId - 1) end return true else item:transform(itemId + 1) player:teleportTo(toPosition, true) end return true end Contato: Email: [email protected] Discord: Dwarfer#2715
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.