Ir para conteúdo
  • Cadastre-se

(Resolvido)[Error] Doors


Ir para solução Resolvido por Alienbear,

Posts Recomendados

[7/6/2015 4:8:30] [Error - Action Interface]
[7/6/2015 4:8:30] data/actions/scripts/other/doors.lua:onUse
[7/6/2015 4:8:30] Description:
[7/6/2015 4:8:30] data/actions/scripts/other/doors.lua:13: attempt to index global 'DOORS' (a nil value)
[7/6/2015 4:8:30] stack traceback:
[7/6/2015 4:8:30]     data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:7>

 

Meu actions/other/doors.lua

 

local function doorEnter(cid, uid, id, position)
    doTransformItem(uid, id)
    doTeleportThing(cid, position)
    return true
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if(fromPosition.x ~= CONTAINER_POSITION and isPlayerPzLocked(cid) and getTileInfo(fromPosition).protection) then
        doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
        return true
    end

    local locked = DOORS[item.itemid]
    if(locked) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        return true
    end

    local door = getItemInfo(item.itemid)
    if(door.levelDoor > 0) then
        if(item.aid == 189) then
            if(not isPremium(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
                return true
            end

            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        local gender = item.aid - 186
        if(isInArray({PLAYERSEX_FEMALE,  PLAYERSEX_MALE}, gender)) then
            if(gender ~= getPlayerSex(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
                return true
            end

            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        local skull = item.aid - 180
        if(skull >= SKULL_NONE and skull <= SKULL_BLACK) then
            if(skull ~= getCreatureSkullType(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
                return true
            end

            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        local group = item.aid - 150
        if(group >= 0 and group < 30) then
            if(group > getPlayerGroupId(cid)) then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
                return true
            end

            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        local vocation = item.aid - 100
        if(vocation >= 0 and vocation < 50) then
            local vocationEx = getVocationInfo(getPlayerVocation(cid))
            if(vocationEx.id ~= vocation and vocationEx.fromVocation ~= vocation) then
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
                return true
            end

            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        if(item.aid == 190 or (item.aid ~= 0 and getPlayerLevel(cid) >= (item.aid - door.levelDoor))) then
            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
        return true
    end

    if(door.specialDoor) then
        if(item.aid == 100 or (item.aid ~= 0 and getCreatureStorage(cid, item.aid) > 0)) then
            return doorEnter(cid, item.uid, door.transformUseTo, toPosition)
        end

        doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
        return true
    end

    toPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
    local fields, thing = getTileItemsByType(fromPosition, ITEM_TYPE_MAGICFIELD), getThingFromPosition(toPosition)
    if(item.uid ~= thing.uid and thing.itemid >= 100 and table.maxn(fields) ~= 0) then
        return true
    end

    local doorCreature = getThingFromPosition(toPosition)
    if(doorCreature.itemid ~= 0) then
        toPosition.x = toPosition.x + 1
        local query = doTileQueryAdd(doorCreature.uid, toPosition, 20) -- allow to stack outside doors, but not on teleports or floor changing tiles
        if(query == RETURNVALUE_NOTPOSSIBLE) then
            toPosition.x = toPosition.x - 1
            toPosition.y = toPosition.y + 1
            query = doTileQueryAdd(doorCreature.uid, toPosition, 20) -- repeat until found
        end

        if(query ~= RETURNVALUE_NOERROR) then
            doPlayerSendDefaultCancel(cid, query)
            return true
        end

        doTeleportThing(doorCreature.uid, toPosition)
        if(not door.closingDoor) then
            doTransformItem(item.uid, door.transformUseTo)
        end

        return true
    end

    return false
end

 

Este problema aconteceu dps que troquei de tfs 0.4 para Otx, ja resolvi todos os erros, mas esse nao consegui, se alguem souber oque faço da um help ae

 

REP + pra quem ajudar!

Editado por gbik (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

cara tente mudar os DOORS por doors

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites

cara tente mudar os DOORS por doors

ja fiz isso e nada :(

Link para o post
Compartilhar em outros sites

então seu distro n tem a função do script


Pode postar sua lib/50-function?

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites

então seu distro n tem a função do script

Pode postar sua lib/50-function?

ai a function

 

function isInArray(array, value, caseSensitive)

    if(caseSensitive == nil or caseSensitive == false) and type(value) == "string" then

        local lowerValue = value:lower()

        for _, _value in ipairs(array) do

            if type(_value) == "string" and lowerValue == _value:lower() then

                return true

            end

        end

    else

        for _, _value in ipairs(array) do

            if (value == _value) then return true end

        end

    end

    return false

end

function setPlayerStorageValueDB(guid, key, value)

   db.executeQuery("UPDATE player_storage SET value = "..value.." WHERE key = "..key.." AND player_id = ".. guid ..";")

   return true

end

function getPlayerStorageValueDB(guid, key)

   local result = db.getResult("SELECT value FROM `player_storage` WHERE key = "..key.." AND player_id = ".. guid ..";")

   if result:getID() ~= -1 then

      return result:getDataInt("value")

   else

      return -1

   end

   result:free()

end

function doPlayerGiveItem(cid, itemid, amount, subType)

    local item = 0

    if(isItemStackable(itemid)) then

        item = doCreateItemEx(itemid, amount)

        if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then

            return false

        end

    else

        for i = 1, amount do

            item = doCreateItemEx(itemid, subType)

            if(doPlayerAddItemEx(cid, item, true) ~= RETURNVALUE_NOERROR) then

                return false

            end

        end

    end

    return true

end

function doPlayerGiveItemContainer(cid, containerid, itemid, amount, subType)

    for i = 1, amount do

        local container = doCreateItemEx(containerid, 1)

        for x = 1, getContainerCapById(containerid) do

            doAddContainerItem(container, itemid, subType)

        end

        if(doPlayerAddItemEx(cid, container, true) ~= RETURNVALUE_NOERROR) then

            return false

        end

    end

    return true

end

function doPlayerTakeItem(cid, itemid, amount)

    return getPlayerItemCount(cid, itemid) >= amount and doPlayerRemoveItem(cid, itemid, amount)

end

function doPlayerSellItem(cid, itemid, count, cost)

    if(not doPlayerTakeItem(cid, itemid, count)) then

        return false

    end

    if(not doPlayerAddMoney(cid, cost)) then

        error('[doPlayerSellItem] Could not add money to: ' .. getPlayerName(cid) .. ' (' .. cost .. 'gp).')

    end

    return true

end

function doPlayerWithdrawMoney(cid, amount)

    if(not getBooleanFromString(getConfigInfo('bankSystem'))) then

        return false

    end

    local balance = getPlayerBalance(cid)

    if(amount > balance or not doPlayerAddMoney(cid, amount)) then

        return false

    end

    doPlayerSetBalance(cid, balance - amount)

    return true

end

function doPlayerDepositMoney(cid, amount)

    if(not getBooleanFromString(getConfigInfo('bankSystem'))) then

        return false

    end

    if(not doPlayerRemoveMoney(cid, amount)) then

        return false

    end

    doPlayerSetBalance(cid, getPlayerBalance(cid) + amount)

    return true

end

function doPlayerAddStamina(cid, minutes)

    return doPlayerSetStamina(cid, getPlayerStamina(cid) + minutes)

end

function isPremium(cid)

    return (isPlayer(cid) and (getPlayerPremiumDays(cid) > 0 or getBooleanFromString(getConfigValue('freePremium'))))

end

function getMonthDayEnding(day)

    if(day == "01" or day == "21" or day == "31") then

        return "st"

    elseif(day == "02" or day == "22") then

        return "nd"

    elseif(day == "03" or day == "23") then

        return "rd"

    end

    return "th"

end

function getMonthString(m)

    return os.date("%B", os.time{year = 1970, month = m, day = 1})

end

function getArticle(str)

    return str:find("[AaEeIiOoUuYy]") == 1 and "an" or "a"

end

function doNumberFormat(i)

    local str, found = string.gsub(i, "(%d)(%d%d%d)$", "%1,%2", 1), 0

    repeat

        str, found = string.gsub(str, "(%d)(%d%d%d),", "%1,%2,", 1)

    until found == 0

    return str

end

function doPlayerAddAddons(cid, addon)

    for i = 0, table.maxn(maleOutfits) do

        doPlayerAddOutfit(cid, maleOutfits, addon)

    end

    for i = 0, table.maxn(femaleOutfits) do

        doPlayerAddOutfit(cid, femaleOutfits, addon)

    end

end

function getTibiaTime(num)

    local minutes, hours = getWorldTime(), 0

    while (minutes > 60) do

        hours = hours + 1

        minutes = minutes - 60

    end

    if(num) then

        return {hours = hours, minutes = minutes}

    end

    return {hours =  hours < 10 and '0' .. hours or '' .. hours, minutes = minutes < 10 and '0' .. minutes or '' .. minutes}

end

function doWriteLogFile(file, text)

    local f = io.open(file, "a+")

    if(not f) then

        return false

    end

    f:write("[" .. os.date("%d/%m/%Y %H:%M:%S") .. "] " .. text .. "\n")

    f:close()

    return true

end

function getExperienceForLevel(lv)

    lv = lv - 1

    return ((50 * lv * lv * lv) - (150 * lv * lv) + (400 * lv)) / 3

end

function doMutePlayer(cid, time)

    local condition = createConditionObject(CONDITION_MUTED, (time == -1 and time or time * 1000))

    return doAddCondition(cid, condition, false)

end

function doSummonCreature(name, pos)

    local cid = doCreateMonster(name, pos, false, false)

    if(not cid) then

        cid = doCreateNpc(name, pos)

    end

    return cid

end

function getPlayersOnlineEx()

    local players = {}

    for i, cid in ipairs(getPlayersOnline()) do

        table.insert(players, getCreatureName(cid))

    end

    return players

end

function getPlayerByName(name)

    local cid = getCreatureByName(name)

    return isPlayer(cid) and cid or nil

end

function isPlayer(cid)

    return isCreature(cid) and cid >= AUTOID_PLAYERS and cid < AUTOID_MONSTERS

end

function isPlayerGhost(cid)

    return isPlayer(cid) and (getCreatureCondition(cid, CONDITION_GAMEMASTER, GAMEMASTER_INVISIBLE, CONDITIONID_DEFAULT) or getPlayerFlagValue(cid, PLAYERFLAG_CANNOTBESEEN))

end

function isMonster(cid)

    return isCreature(cid) and cid >= AUTOID_MONSTERS and cid < AUTOID_NPCS

end

function isNpc(cid)

    -- Npc IDs are over int32_t range (which is default for lua_pushnumber),

    -- therefore number is always a negative value.

    return isCreature(cid) and (cid < 0 or cid >= AUTOID_NPCS)

end

function isUnderWater(cid)

    return isInArray(underWater, getTileInfo(getCreaturePosition(cid)).itemid)

end

function doPlayerAddLevel(cid, amount, round)

    local experience, level, amount = 0, getPlayerLevel(cid), amount or 1

    if(amount > 0) then

        experience = getExperienceForLevel(level + amount) - (round and getPlayerExperience(cid) or getExperienceForLevel(level))

    else

        experience = -((round and getPlayerExperience(cid) or getExperienceForLevel(level)) - getExperienceForLevel(level + amount))

    end

    return doPlayerAddExperience(cid, experience)

end

function doPlayerAddMagLevel(cid, amount)

    local amount = amount or 1

    for i = 1, amount do

        doPlayerAddSpentMana(cid, getPlayerRequiredMana(cid, getPlayerMagLevel(cid, true) + 1) - getPlayerSpentMana(cid), false)

    end

    return true

end

function doPlayerAddSkill(cid, skill, amount, round)

    local amount = amount or 1

    if(skill == SKILL__LEVEL) then

        return doPlayerAddLevel(cid, amount, round)

    elseif(skill == SKILL__MAGLEVEL) then

        return doPlayerAddMagLevel(cid, amount)

    end

    for i = 1, amount do

        doPlayerAddSkillTry(cid, skill, getPlayerRequiredSkillTries(cid, skill, getPlayerSkillLevel(cid, skill) + 1) - getPlayerSkillTries(cid, skill), false)

    end

    return true

end

function isPrivateChannel(channelId)

    return channelId >= CHANNEL_PRIVATE

end

function doBroadcastMessage(text, class)

    local class = class or MESSAGE_STATUS_WARNING

    if(type(class) == 'string') then

        local className = MESSAGE_TYPES[class]

        if(className == nil) then

            return false

        end

        class = className

    elseif(class < MESSAGE_FIRST or class > MESSAGE_LAST) then

        return false

    end

    for _, pid in ipairs(getPlayersOnline()) do

        doPlayerSendTextMessage(pid, class, text)

    end

    print("> Broadcasted message: \"" .. text .. "\".")

    return true

end

function doPlayerBroadcastMessage(cid, text, class, checkFlag, ghost)

    local checkFlag, ghost, class = checkFlag or true, ghost or false, class or TALKTYPE_BROADCAST

    if(checkFlag and not getPlayerFlagValue(cid, PLAYERFLAG_CANBROADCAST)) then

        return false

    end

    if(type(class) == 'string') then

        local className = TALKTYPE_TYPES[class]

        if(className == nil) then

            return false

        end

        class = className

    elseif(class < TALKTYPE_FIRST or class > TALKTYPE_LAST) then

        return false

    end

    for _, pid in ipairs(getPlayersOnline()) do

        doCreatureSay(cid, text, class, ghost, pid)

    end

    print("> " .. getCreatureName(cid) .. " broadcasted message: \"" .. text .. "\".")

    return true

end

function doCopyItem(item, attributes)

    local attributes = ((type(attributes) == 'table') and attributes or { "aid" })

    local ret = doCreateItemEx(item.itemid, item.type)

    for _, key in ipairs(attributes) do

        local value = getItemAttribute(item.uid, key)

        if(value ~= nil) then

            doItemSetAttribute(ret, key, value)

        end

    end

    if(isContainer(item.uid)) then

        for i = (getContainerSize(item.uid) - 1), 0, -1 do

            local tmp = getContainerItem(item.uid, i)

            if(tmp.itemid > 0) then

                doAddContainerItemEx(ret, doCopyItem(tmp, true).uid)

            end

        end

    end

    return getThing(ret)

end

function doSetItemText(uid, text, writer, date)

    local thing = getThing(uid)

    if(thing.itemid < 100) then

        return false

    end

    doItemSetAttribute(uid, "text", text)

    if(writer ~= nil) then

        doItemSetAttribute(uid, "writer", tostring(writer))

        if(date ~= nil) then

            doItemSetAttribute(uid, "date", tonumber(date))

        end

    end

    return true

end

function getItemWeightById(itemid, count, precision)

    local item, count, precision = getItemInfo(itemid), count or 1, precision or false

    if(not item) then

        return false

    end

    if(count > 100) then

        -- print a warning, as its impossible to have more than 100 stackable items without "cheating" the count

        print('[Warning] getItemWeightById', 'Calculating weight for more than 100 items!')

    end

    local weight = item.weight * count

    return precission and weight or math.round(weight, 2)

end

function choose(...)

    local arg, ret = {...}

    if type(arg[1]) == 'table' then

        ret = arg[1][math.random(#arg[1])]

    else

        ret = arg[math.random(#arg)]

    end

    return ret

end

function doPlayerAddExpEx(cid, amount)

    if(not doPlayerAddExp(cid, amount)) then

        return false

    end

    local position = getThingPosition(cid)

    doPlayerSendTextMessage(cid, MESSAGE_EXPERIENCE, "You gained " .. amount .. " experience.", amount, COLOR_WHITE, position)

    local spectators, name = getSpectators(position, 7, 7), getCreatureName(cid)

    for _, pid in ipairs(spectators) do

        if(isPlayer(pid) and cid ~= pid) then

            doPlayerSendTextMessage(pid, MESSAGE_EXPERIENCE_OTHERS, name .. " gained " .. amount .. " experience.", amount, COLOR_WHITE, position)

        end

    end

    return true

end

function getItemTopParent(uid)

    local parent = getItemParent(uid)

    if(not parent or parent.uid == 0) then

        return nil

    end

    while(true) do

        local tmp = getItemParent(parent.uid)

        if(tmp and tmp.uid ~= 0) then

            parent = tmp

        else

            break

        end

    end

    return parent

end

function getItemHolder(uid)

    local parent = getItemParent(uid)

    if(not parent or parent.uid == 0) then

        return nil

    end

    local holder = nil

    while(true) do

        local tmp = getItemParent(parent.uid)

        if(tmp and tmp.uid ~= 0) then

            if(tmp.itemid == 1) then -- a creature

                holder = tmp

                break

            end

            parent = tmp

        else

            break

        end

    end

    return holder

end

function valid(f)

    return function(p, ...)

        if(isCreature(p)) then

            return f(p, ...)

        end

    end

end

function addContainerItems(container,items)

    local items_mod = {}

    for _, it in ipairs(items) do

        if( isItemStackable(it.id) and it.count > 100) then

            local c = it.count

            while( c > 100 ) do

                table.insert(items_mod,{id = it.id,count = 100})

                c = c - 100

            end

            if(c > 0) then

                table.insert(items_mod,{id = it.id,count = c})

            end

        else

            table.insert(items_mod,{id = it.id,count = 1})

        end

    end

    local free = getContainerCap(container.uid) - (getContainerSize(container.uid) )

    local count = math.ceil(#items_mod/ free)

    local main_bp = container.uid

    local insert_bp = main_bp

    local counter = 1

    for c,it in ipairs(items_mod) do

        local _c = isItemStackable(it.id) and (it.count > 100 and 100 or it.count) or 1

        if count > 1 then

            if (counter < free) then

                doAddContainerItem(insert_bp, it.id, _c)

            else

                insert_bp = doAddContainerItem(insert_bp, container.itemid, 1)

                count = (#items_mod)-(free-1)

                free = getContainerCap(insert_bp)

                count = math.ceil(count/ free)

                doAddContainerItem(insert_bp, it.id, _c)

                counter = 1

            end

            counter = counter + 1

        else

            doAddContainerItem(insert_bp, it.id, _c)

        end

    end

    return main_bp

end

 

o erro é esse

 

7/6/2015 4:46:19] [Error - Action Interface]

[7/6/2015 4:46:19] data/actions/scripts/other/doors.lua:onUse

[7/6/2015 4:46:20] Description:

[7/6/2015 4:46:20] data/actions/scripts/other/doors.lua:13: attempt to index global 'doors' (a nil value)

[7/6/2015 4:46:20] stack traceback:

[7/6/2015 4:46:20]     data/actions/scripts/other/doors.lua:13: in function <data/actions/scripts/other/doors.lua:7>

 

Editado por gbik (veja o histórico de edições)
Link para o post
Compartilhar em outros sites

 local locked = DOORS[item.itemid]
    if(locked) then
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        return true
    end
 


todas as portas estão dando isso?

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites

 local locked = DOORS[item.itemid]

    if(locked) then

        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")

        return true

    end

 

todas as portas estão dando isso?

 

Estava kkkkkkkkk, agora voltou o erro e a porta não abre :S

Link para o post
Compartilhar em outros sites

function onUse(cid, item, fromPosition, itemEx, toPosition)
    if isInArray(questDoors, item.itemid) == TRUE then
        if getPlayerStorageValue(cid, item.actionid) ~= -1 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
        end
        return TRUE
    elseif isInArray(levelDoors, item.itemid) == TRUE then
        if item.actionid > 0 and getPlayerLevel(cid) >= item.actionid - 1000 then
            doTransformItem(item.uid, item.itemid + 1)
            doTeleportThing(cid, toPosition, TRUE)
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
        end
        return TRUE
    elseif isInArray(keys, item.itemid) == TRUE then
        if itemEx.actionid > 0 then
            if item.actionid == itemEx.actionid then
                if doors[itemEx.itemid] ~= nil then
                    doTransformItem(itemEx.uid, doors[itemEx.itemid])
                    return TRUE
                end
            end
            doPlayerSendCancel(cid, "The key does not match.")
            return TRUE
        end
        return FALSE
    elseif isInArray(horizontalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.y = newPosition.y + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif isInArray(verticalOpenDoors, item.itemid) == TRUE then
        local newPosition = toPosition
        newPosition.x = newPosition.x + 1
        local doorPosition = fromPosition
        doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
        local doorCreature = getThingfromPos(doorPosition)
        if doorCreature.itemid ~= 0 then
            if getTilePzInfo(doorPosition) == TRUE and getTilePzInfo(newPosition) == FALSE and doorCreature.uid ~= cid then
                doPlayerSendCancel(cid, "Sorry, not possible.")
            else
                doTeleportThing(doorCreature.uid, newPosition, TRUE)
                if isInArray(openSpecialDoors, item.itemid) ~= TRUE then
                    doTransformItem(item.uid, item.itemid - 1)
                end
            end
            return TRUE
        end
        doTransformItem(item.uid, item.itemid - 1)
        return TRUE
    elseif doors[item.itemid] ~= nil then
        if item.actionid == 0 then
            doTransformItem(item.uid, doors[item.itemid])
        else
            doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
        end
        return TRUE
    end
    return FALSE
end

 
 
 
tenta usar esse ai por favor?

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites

[7/6/2015 4:58:23] [Error - Action Interface]
[7/6/2015 4:58:24] data/actions/scripts/other/doors.lua:onUse
[7/6/2015 4:58:24] Description:
[7/6/2015 4:58:24] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)
[7/6/2015 4:58:24] stack traceback:
[7/6/2015 4:58:24]     [C]: in function 'ipairs'
[7/6/2015 4:58:24]     data/lib/050-function.lua:10: in function 'isInArray'
[7/6/2015 4:58:24]     data/actions/scripts/other/doors.lua:2: in function <data/actions/scripts/other/doors.lua:1>

 

Link para o post
Compartilhar em outros sites

tenta assim: 

 

local function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingFromPos(position)

position.stackpos = STACKPOS_TOP_FIELD
local field = getThingFromPos(position)

return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getItemLevelDoor(item.itemid) > 0) then
if(item.actionid == 189) then
if(isPremium(cid) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local gender = item.actionid - 186
if(isInArray({PLAYERSEX_FEMALE,  PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then
local playerGender = getPlayerSex(cid)
if(playerGender ~= gender) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local skull = item.actionid - 180
if(skull >= 0 and skull < 6) then
local playerSkull = getCreatureSkullType(cid)
if(playerSkull ~= skull) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local group = item.actionid - 150
if(group >= 0 and group < 30) then
local playerGroup = getPlayerGroupId(cid)
if(playerGroup < group) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local vocation = item.actionid - 100
if(vocation >= 0 and vocation < 50) then
local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end

return TRUE
end

if(isInArray(specialDoors, item.itemid) == TRUE) then
if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end

return TRUE
end

if(isInArray(keys, item.itemid) == TRUE) then
if(itemEx.actionid > 0) then
if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return TRUE
end

doPlayerSendCancel(cid, "The key does not match.")
return TRUE
end

return FALSE
end

if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then
if(item.actionid == 0) then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end

return TRUE
end

return FALSE
end
Editado por Alienbear (veja o histórico de edições)

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092, 10032, 10091}
closingDoors = {1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133, 5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558, 9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10780, 10782, 10789, 10791}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10483, 10485, 10789, 10791}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285, 10470, 10472, 10474, 10476, 10780, 10782}

doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1539] = 1540, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085, [5098] = 5100, [5099] = 5100, [5101] = 5102, [5107] = 5109, [5108] = 5109, [5110] = 5111, [5116] = 5118, [5117] = 5118, [5119] = 5120, [5125] = 5127, [5126] = 5127, [5128] = 5129, [5134] = 5136, [5135] = 5136, [5137] = 5139, [5138] = 5139, [5140] = 5142, [5141] = 5142, [5143] = 5145, [5144] = 5145, [5278] = 5280, [5279] = 5280, [5281] = 5283, [5282] = 5283, [5284] = 5285, [5286] = 5287, [5515] = 5516, [5517] = 5518, [5732] = 5734, [5733] = 5734, [5735] = 5737, [5736] = 5737, [6192] = 6194, [6193] = 6194, [6195] = 6197, [6196] = 6197, [6198] = 6199, [6200] = 6201, [6249] = 6251, [6250] = 6251, [6252] = 6254, [6253] = 6254, [6255] = 6256, [6257] = 6258, [6795] = 6796, [6797] = 6798, [6799] = 6800, [6801] = 6802, [6891] = 6893, [6892] = 6893, [6894] = 6895, [6900] = 6902, [6901] = 6902, [6903] = 6904, [7033] = 7035, [7034] = 7035, [7036] = 7037, [7042] = 7044, [7043] = 7044, [7045] = 7046, [7054] = 7055, [7056] = 7057, [8541] = 8543, [8542] = 8543, [8544] = 8546, [8545] = 8546, [8547] = 8548, [8549] = 8550, [9165] = 9167, [9166] = 9167, [9168] = 9170, [9169] = 9170, [9171] = 9172, [9173] = 9174, [9267] = 9269, [9268] = 9269, [9270] = 9272, [9271] = 9272, [9273] = 9274, [9275] = 9276, [10276] = 10277, [10274] = 10275, [10268] = 10270, [10269] = 10270, [10271] = 10273, [10272] = 10273, [10471] = 10472, [10480] = 10481, [10477] = 10479, [10478] = 10479, [10468] = 10470, [10469] = 10470, [10774] = 10776, [10775] = 10776, [10779] = 10780, [10781] = 10782, [10783] = 10785, [10784] = 10785, [10788] = 10789, [10790] = 10791}
specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279, 10278, 10280, 10475, 10484, 10781, 10790}

tenta adicionar isso em 000-constant

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
keys = {2086, 2087, 2088, 2089, 2090, 2091, 2092, 10032, 10091}
closingDoors = {1224, 1226, 1228, 1230, 1242, 1244, 1246, 1248, 1256, 1258, 1260, 1262, 3541, 3543, 3550, 3552, 5104, 5106, 5113, 5115, 5122, 5124, 5131, 5133, 5289, 5291, 5293, 5295, 6203, 6205, 6207, 6209, 6260, 6262, 6264, 6266, 6897, 6899, 6906, 6908, 7039, 7041, 7048, 7050, 8552, 8554, 8556, 8558, 9176, 9178, 9180, 9182, 9278, 9280, 9282, 9284, 10279, 10281, 10283, 10285, 10474, 10476, 10483, 10485, 10780, 10782, 10789, 10791}
verticalOpenDoors = {1211, 1220, 1224, 1228, 1233, 1238, 1242, 1246, 1251, 1256, 1260, 1540, 3546, 3548, 3550, 3552, 4915, 5083, 5109, 5111, 5113, 5115, 5127, 5129, 5131, 5133, 5142, 5145, 5283, 5285, 5289, 5293, 5516, 5737, 5749, 6194, 6199, 6203, 6207, 6251, 6256, 6260, 6264, 6798, 6802, 6902, 6904, 6906, 6908, 7044, 7046, 7048, 7050, 7055, 8543, 8548, 8552, 8556, 9167, 9172, 9269, 9274, 9278, 9282, 10270, 10275, 10279, 10283, 10479, 10481, 10483, 10485, 10789, 10791}
horizontalOpenDoors = {1214, 1222, 1226, 1230, 1236, 1240, 1244, 1248, 1254, 1258, 1262, 1542, 3537, 3539, 3541, 3543, 4918, 5085, 5100, 5102, 5104, 5106, 5118, 5120, 5122, 5124, 5136, 5139, 5280, 5287, 5291, 5295, 5518, 5734, 5746, 6197, 6201, 6205, 6209, 6254, 6258, 6262, 6266, 6796, 6800, 6893, 6895, 6897, 6899, 7035, 7037, 7039, 7041, 7057, 8546, 8550, 8554, 8558, 9170, 9174, 9272, 9276, 9280, 9284, 10273, 10277, 10281, 10285, 10470, 10472, 10474, 10476, 10780, 10782}

doors = {[1209] = 1211, [1210] = 1211, [1212] = 1214, [1213] = 1214, [1219] = 1220, [1221] = 1222, [1231] = 1233, [1232] = 1233, [1234] = 1236, [1235] = 1236, [1237] = 1238, [1239] = 1240, [1249] = 1251, [1250] = 1251, [1252] = 1254, [1253] = 1254, [1539] = 1540, [1541] = 1542, [3535] = 3537, [3536] = 3537, [3538] = 3539, [3544] = 3546, [3545] = 3546, [3547] = 3548, [4913] = 4915, [4914] = 4915, [4916] = 4918, [4917] = 4918, [5082] = 5083, [5084] = 5085, [5098] = 5100, [5099] = 5100, [5101] = 5102, [5107] = 5109, [5108] = 5109, [5110] = 5111, [5116] = 5118, [5117] = 5118, [5119] = 5120, [5125] = 5127, [5126] = 5127, [5128] = 5129, [5134] = 5136, [5135] = 5136, [5137] = 5139, [5138] = 5139, [5140] = 5142, [5141] = 5142, [5143] = 5145, [5144] = 5145, [5278] = 5280, [5279] = 5280, [5281] = 5283, [5282] = 5283, [5284] = 5285, [5286] = 5287, [5515] = 5516, [5517] = 5518, [5732] = 5734, [5733] = 5734, [5735] = 5737, [5736] = 5737, [6192] = 6194, [6193] = 6194, [6195] = 6197, [6196] = 6197, [6198] = 6199, [6200] = 6201, [6249] = 6251, [6250] = 6251, [6252] = 6254, [6253] = 6254, [6255] = 6256, [6257] = 6258, [6795] = 6796, [6797] = 6798, [6799] = 6800, [6801] = 6802, [6891] = 6893, [6892] = 6893, [6894] = 6895, [6900] = 6902, [6901] = 6902, [6903] = 6904, [7033] = 7035, [7034] = 7035, [7036] = 7037, [7042] = 7044, [7043] = 7044, [7045] = 7046, [7054] = 7055, [7056] = 7057, [8541] = 8543, [8542] = 8543, [8544] = 8546, [8545] = 8546, [8547] = 8548, [8549] = 8550, [9165] = 9167, [9166] = 9167, [9168] = 9170, [9169] = 9170, [9171] = 9172, [9173] = 9174, [9267] = 9269, [9268] = 9269, [9270] = 9272, [9271] = 9272, [9273] = 9274, [9275] = 9276, [10276] = 10277, [10274] = 10275, [10268] = 10270, [10269] = 10270, [10271] = 10273, [10272] = 10273, [10471] = 10472, [10480] = 10481, [10477] = 10479, [10478] = 10479, [10468] = 10470, [10469] = 10470, [10774] = 10776, [10775] = 10776, [10779] = 10780, [10781] = 10782, [10783] = 10785, [10784] = 10785, [10788] = 10789, [10790] = 10791}
specialDoors = {1223, 1225, 1241, 1243, 1255, 1257, 3542, 3551, 5105, 5114, 5123, 5132, 5288, 5290, 5745, 5748, 6202, 6204, 6259, 6261, 6898, 6907, 7040, 7049, 8551, 8553, 9175, 9177, 9277, 9279, 10278, 10280, 10475, 10484, 10781, 10790}

tenta adicionar isso em 000-constant

 

okay.

 

[7/6/2015 5:11:30] [Error - Action Interface]

[7/6/2015 5:11:30] data/actions/scripts/other/doors.lua:onUse

[7/6/2015 5:11:30] Description:

[7/6/2015 5:11:30] data/lib/050-function.lua:10: bad argument #1 to 'ipairs' (table expected, got nil)

[7/6/2015 5:11:30] stack traceback:

[7/6/2015 5:11:31]     [C]: in function 'ipairs'

[7/6/2015 5:11:31]     data/lib/050-function.lua:10: in function 'isInArray'

[7/6/2015 5:11:31]     data/actions/scripts/other/doors.lua:2: in function <data/actions/scripts/other/doors.lua:1>

 

Editado por gbik (veja o histórico de edições)
Link para o post
Compartilhar em outros sites
  • Solução
local function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingFromPos(position)

position.stackpos = STACKPOS_TOP_FIELD
local field = getThingFromPos(position)

return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getItemLevelDoor(item.itemid) > 0) then
if(item.actionid == 189) then
if(isPremium(cid) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local gender = item.actionid - 186
if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then
local playerGender = getPlayerSex(cid)
if(playerGender ~= gender) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local skull = item.actionid - 180
if(skull >= 0 and skull < 6) then
local playerSkull = getCreatureSkullType(cid)
if(playerSkull ~= skull) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local group = item.actionid - 150
if(group >= 0 and group < 30) then
local playerGroup = getPlayerGroupId(cid)
if(playerGroup < group) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local vocation = item.actionid - 100
if(vocation >= 0 and vocation < 50) then
local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end

return TRUE
end

if(isInArray(specialDoors, item.itemid) == TRUE) then
if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end

return TRUE
end

if(isInArray(keys, item.itemid) == TRUE) then
if(itemEx.actionid > 0) then
if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return TRUE
end

doPlayerSendCancel(cid, "The key does not match.")
return TRUE
end

return FALSE
end

if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then
if(item.actionid == 0) then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end

return TRUE
end

return FALSE
end
Editado por Alienbear (veja o histórico de edições)

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
local function checkStackpos(item, position)
position.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local thing = getThingFromPos(position)

position.stackpos = STACKPOS_TOP_FIELD
local field = getThingFromPos(position)

return (item.uid == thing.uid or thing.itemid < 100 or field.itemid == 0)
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
if(getItemLevelDoor(item.itemid) > 0) then
if(item.actionid == 189) then
if(isPremium(cid) ~= TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local gender = item.actionid - 186
if(isInArray({PLAYERSEX_FEMALE, PLAYERSEX_MALE, PLAYERSEX_GAMEMASTER}, gender) == TRUE) then
local playerGender = getPlayerSex(cid)
if(playerGender ~= gender) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local skull = item.actionid - 180
if(skull >= 0 and skull < 6) then
local playerSkull = getCreatureSkullType(cid)
if(playerSkull ~= skull) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local group = item.actionid - 150
if(group >= 0 and group < 30) then
local playerGroup = getPlayerGroupId(cid)
if(playerGroup < group) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

local vocation = item.actionid - 100
if(vocation >= 0 and vocation < 50) then
local playerVocationInfo = getVocationInfo(getPlayerVocation(cid))
if(playerVocationInfo.id ~= vocation and playerVocationInfo.fromVocation ~= vocation) then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
return TRUE
end

doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
return TRUE
end

if(item.actionid == 190 or (item.actionid ~= 0 and getPlayerLevel(cid) >= (item.actionid - getItemLevelDoor(item.itemid)))) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Only the worthy may pass.")
end

return TRUE
end

if(isInArray(specialDoors, item.itemid) == TRUE) then
if(item.actionid == 100 or (item.actionid ~= 0 and getPlayerStorageValue(cid, item.actionid) > 0)) then
doTransformItem(item.uid, item.itemid + 1)
doTeleportThing(cid, toPosition, TRUE)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The door seems to be sealed against unwanted intruders.")
end

return TRUE
end

if(isInArray(keys, item.itemid) == TRUE) then
if(itemEx.actionid > 0) then
if(item.actionid == itemEx.actionid and doors[itemEx.itemid] ~= nil) then
doTransformItem(itemEx.uid, doors[itemEx.itemid])
return TRUE
end

doPlayerSendCancel(cid, "The key does not match.")
return TRUE
end

return FALSE
end

if(isInArray(horizontalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.y = newPosition.y + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(isInArray(verticalOpenDoors, item.itemid) == TRUE and checkStackpos(item, fromPosition)) then
local newPosition = toPosition
newPosition.x = newPosition.x + 1
local doorPosition = fromPosition
doorPosition.stackpos = STACKPOS_TOP_MOVEABLE_ITEM_OR_CREATURE
local doorCreature = getThingfromPos(doorPosition)
if(doorCreature.itemid ~= 0) then
if(getTileInfo(doorPosition).protection and not getTileInfo(newPosition).protection and doorCreature.uid ~= cid) then
doPlayerSendDefaultCancel(cid, RETURNVALUE_NOTPOSSIBLE)
else
doTeleportThing(doorCreature.uid, newPosition, TRUE)
if(isInArray(closingDoors, item.itemid) ~= TRUE) then
doTransformItem(item.uid, item.itemid - 1)
end
end

return TRUE
end

doTransformItem(item.uid, item.itemid - 1)
return TRUE
end

if(doors[item.itemid] ~= nil and checkStackpos(item, fromPosition)) then
if(item.actionid == 0) then
doTransformItem(item.uid, doors[item.itemid])
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is locked.")
end

return TRUE
end

return FALSE
end

Nossa mano, ce é foda  <3, vlw mesmo, acho que funfou agora kkk, um dia eu chego nesse nível kkk

Link para o post
Compartilhar em outros sites

q nada :D...

mas fica a dica: otx n é muito completo :X

547657261_assinaturatibiaking.jpg.c1cc2728d9b7e7142cd10bf237f3370d.jpg

'' Uma ideia é apenas uma ideia, até ser desenvolvida, mastigada, retratada, analisada e por fim se tornar uma boa ideia. ''

Link para o post
Compartilhar em outros sites
  • 1 month later...
  • 1 year later...
  • 5 months later...

Estou com esse problema alguem poode me ajudar

 

Lua Script Error: [MoveEvents Interface]
data/movements/scripts/sumon.lua:onStepIn
data/movements/scripts/sumon.lua:5: attempt to call global 'isPlayer' (a nil value)
stack traceback:
        [C]: in function 'isPlayer'
        data/movements/scripts/sumon.lua:5: in function <data/movements/scripts/sumon.lua:4>

Link para o post
Compartilhar em outros sites

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

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

  • Conteúdo Similar

    • Por BonasxD
      Bom galera primeiramente não sei se estou na area correta ou se nao estou, se nao por favor mover para area certa, grato!
      Estou com esse erro ao tenta instalar o gesior usando a tfs 0.4 não passa dessa parte ja tentei de tudo e nao sei oque fazer ;(
       
      Testei o mesmo procedimento no meu Windows e Funcionou corretamente agora no meu VM(Ubuntu22) não passa desse erro. 
       
      Ja pesquisei por tudo e não sei oque fazer

    • Por Kill of sumoners
      Boa noite, estou com um erro ao atacar um player em meu sv eu nao pego pk, nem sai magia, aparece a mensagem "voce so pode usar isso em criaturas"
      obs: magia em area acerta e pega pk, apenas as targets ou hits de arma nao vao 
    • Por Guilherme HP
      ola boa noite, alguem poderia ta me ajudando nesse erro que apareceu na minha vps quando vou abrir o meu game?

      [./tfs: error while loading shared libraries: libluajit-5.1.so.2: cannot open shared object file: No such file or directory]
    • Por Biel249
      Bom dia. Estou passando por esse problema com meu otserver tibia 8.6 eu coloco online tudo certinho portas abertas dmz e dns configurada mas não fica on só eu consigo entrar. Ja entrei em contato com a fornecedora de Internet eles alegaram que meu ip é privado e só conseguiria pagando um ip público. Alguém me ajuda????
×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo