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

Lua Adding items into a container!

MrSheen

Php & Lua.
Joined
Jun 14, 2007
Messages
159
Reaction score
2
Location
Nottingham, England
Hey, how do you add items into a container?

I've made a quest and when you click the chest you need to get two items into a bag, how would this be possible?

Thanks.
 
Give me the IDs of the bag, and the items you want to get in the bag. And also the storageID you want it to use, and I will make it for you. ;)
 
Well i've made most of the script =] I dont like people making the whole script for me, because you dont learn! :p

you will get an life ring (id 2168) and a pick (id 2553) inside a bag (id 1987).

just show me the code to do this :)

Thanks Empty xD
 
container = bag Id
1= How many bags should get added?
local backpack = doPlayerAddItem(cid, container, 1)

Backpack = ignore it leave it like that
itemid= what item should there be inside?
charges= how many charges or items should be inside the bag
doAddContainerItem(backpack, itemid, charges)

Code:
local backpack = doPlayerAddItem(cid, container, 1)
				doAddContainerItem(backpack, itemid, charges)
 
No problems.. xD

Code:
function onUse(cid,item,frompos,topos)

    local questDone = getPlayerStorageValue(cid,CHANGE)

    if questDone < 1 then
        local bag = doPlayerAddItem(cid,1987,1)
        doAddContainerItem(bag,2168,1)
        doAddContainerItem(bag,2553,1)
    else
        doPlayerSendTextMessage(cid,22,'It is empty.')
    end
end
 
Back
Top