• 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 Question about reward chest containing a bag of...

auda

Advanced OT User
Joined
Jun 29, 2014
Messages
273
Reaction score
233
Location
Sweden
Hey! I've been searching here and haven't really gotten the "right" answer - even though this seems to be very simple.

I just wanted to ask how to have a bag containing items as a reward. Containing, for example, a few gold coins and an amulet maybe?

This is my regular script, which I want to make into a container with the dark armor.
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.actionid == 1000 then
        queststatus = getPlayerStorageValue(cid, 5000)

    if queststatus == -1 then
    setPlayerStorageValue(cid, 5000, 1)
    doPlayerAddItem(cid, 2489, 1)
    doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a dark armor.")
    else
    doPlayerSendTextMessage(cid, 22, "It is empty.")
    end
end

return TRUE

end

Thanks!
 
Which tfs version?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, 5000) ~= 1 then
        setPlayerStorageValue(cid, 5000, 1)
        local bag = doPlayerAddItem(cid, 1987, 1) --this is the bag
        doAddContainerItem(bag, 2489, 1) --this item will be added into the bag.
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a dark armor.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end
 
Which tfs version?

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getPlayerStorageValue(cid, 5000) ~= 1 then
        setPlayerStorageValue(cid, 5000, 1)
        local bag = doPlayerAddItem(cid, 1987, 1) --this is the bag
        doAddContainerItem(bag, 2489, 1) --this item will be added into the bag.
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a dark armor.")
    else
        doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
    end
    return true
end

I actually use Avesta 0.6.5 (7.40)

But I will try it out! :)

Solved: It worked! Thank you! :)
 
Last edited by a moderator:
Back
Top