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

Quest problem


Having 2 chests/items with the same uid will create some error message in your console.
Id say the easiest way is to just create a lua script for the chests, loading both uids to that script and check the same storage value.
You can use this script:
Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local box = {
        [xxx] = {itemId = xxxx, name = "a dragon scale mail"},
        [xxx] = {itemId = xxxx, name = "a pair of knight legs"}
    }
   
    local v = box[item.uid]
    if(v) then
        local p = Player(cid)
        if(p:getStorageValue(49254) ~= 1) then
            p:setStorageValue(49254, 1)
            p:addItem(v.itemId, 1)
            local item = Item(v.itemId)
            p:sendTextMessage(MESSAGE_INFO_DESCR, "You have found " .. v.name .. ".")
        else
            p:sendTextMessage(MESSAGE_INFO_DESCR, "The chest is empty.")
        end
    end
return true
end
Change the xxx to the uid of the chest, xxxx of the itemid and the 49254 for the storage you wanna give the player.
The same goes for inq and anni quests, you use one script and then the same storage to void that the player takes more then 1.
 
Choosing one of more items is already possible with the system.lua, just follow the second part of the tutorial.
 
Back
Top