• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Gate of expertise door problem tfs 1.3 otc v 2.4

skeira97

New Member
Joined
Dec 12, 2011
Messages
13
Reaction score
0
Hey folks!

I got this lvldoor problem with id 5103 (cuz its the one im using) gate of expertise.. so when i open the door it works with lvl 500 or above it opens, but when open it wont go back to closed, ive checked door

here is my doors.lua anything in here that causes it? and ive checked so the door id is in events


Code:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    local itemId = item:getId()
    if table.contains(questDoors, itemId) then
        if player:getStorageValue(item.actionid) ~= -1 then
            item:transform(itemId + 1)
            player:teleportTo(toPosition, true)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "The door seems to be sealed against unwanted intruders.")
        end
        return true
    elseif table.contains(levelDoors, itemId) then
        if item.actionid > 0 and player:getLevel() >= item.actionid - actionIds.levelDoor then
            item:transform(itemId + 1)
            player:teleportTo(toPosition, true)
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "Only the worthy may pass.")
        end
        return true
    elseif table.contains(keys, itemId) then
        if target.actionid > 0 then
            if item.actionid == target.actionid and doors[target.itemid] then
                target:transform(doors[target.itemid])
                return true
            end
            player:sendTextMessage(MESSAGE_STATUS_SMALL, "The key does not match.")
            return true
        end
        return false
    end
    if table.contains(horizontalOpenDoors, itemId) or table.contains(verticalOpenDoors, itemId) then
        local doorCreature = Tile(toPosition):getTopCreature()
        if doorCreature 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, Game.getReturnMessage(query))
                return true
            end
            doorCreature:teleportTo(toPosition, true)
        end
        if not table.contains(openSpecialDoors, itemId) then
            item:transform(itemId - 1)
        end
        return true
    end
    if doors[itemId] then
        if item.actionid == 0 then
            item:transform(doors[itemId])
        else
            player:sendTextMessage(MESSAGE_EVENT_ADVANCE, "It is locked.")
        end
        return true
    end
    return false
end
 
data\movements\scripts\closingdoor.lua


Thank you so much!

And one thing more, if i want to make a lever usable to purchase item where do i edit levers to have a buy function?
Post automatically merged:

Thank you so much!

And one thing more, if i want to make a lever usable to purchase item where do i edit levers to have a buy function?


like in this picture Gyazo (https://gyazo.com/3f3295643cf8dde2f4707438904ea7e3) to add like different prices on the levers?
 
Back
Top