• 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!

Solved Doors problem

MxSoft

Leave Tibia, Live Life.
Joined
Dec 22, 2009
Messages
1,804
Solutions
1
Reaction score
43
Location
Mexico
Hi im having issues with all my doors that are like this:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    for i = 10001, 10008 do
        if getPlayerStorageValue(cid, i) > 0 then
            return doTransformItem(item.uid, item.itemid + 1) and doTeleportThing(cid, toPosition, true)
        end
    end
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It seems this door is sealed against unwanted intruders.")

end
The ones with this function "return doTransformItem(item.uid, item.itemid + 1) and doTeleportThing(cid, toPosition, true)"
Example:
if you click again while you still under the door its get bugged because it gets transformed again so people abuse of this bug to block quests
 
You can check for itemid of the closed doors that are used.
Code:
if isInArray({1227, 1229, 1261}, item.itemid) then
 
So it would be like this?:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    for i = 10001, 10008 do
if isInArray({1228}, item.itemid) then
        elseif getPlayerStorageValue(cid, i) > 0 then
            return doTransformItem(item.uid, item.itemid + 1) and doTeleportThing(cid, toPosition, true)
        end
    end
    return doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It seems this door is sealed against unwanted intruders.")

end
 
1228 is an open door, use ids of the closed doors you used.
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
     if isInArray({1227, 1229, 1261}, item.itemid) then
         for i = 10001, 10008 do
             if getPlayerStorageValue(cid, i) > 0 then
                 return doTransformItem(item.uid, item.itemid + 1) and doTeleportThing(cid, toPosition, true)
             end
         end
         doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It seems this door is sealed against unwanted intruders.")
     end
     return true
end
 
Back
Top