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

Help With Chest

Beef Jerky

New Member
Joined
Sep 19, 2008
Messages
68
Reaction score
0
ok im using this Script on a 7.6 Server < very old plx>


anyways


function onUse(cid, item) -- fill in more
local itemsIn = { chain arm,
katana,
and so on
}
local bpId = xxxx
if getPlayerStorageValue(cid, xxxx) == FALSE then
local container = doPlayerAddItem(cid, bpId, 1)
for i = 1,table.maxn(itemsIn) do
doAddContainerItem(container, itemsIn, 1)
end
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have found a backpack.")
setPlayerStorageValue(cid, xxxx, 1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.")
end
end



how doi make it so i get dwarven set

this is the codes for the set

Arm 2503
Legs 2504
Helm 2502
shield 2525
Wep 2435


could anymake that script work or teach me how sorry ive tried but i guess i suck ;D
 
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == xxxx then -- the unique id of chest
        queststatus = getPlayerStorageValue(cid,xxxx) --storage value, keep at chests unique id
        if queststatus == -1 then -- checks if quest is done
            doPlayerSendTextMessage(cid,22,"You have found a bag")  --Massage when open
            Container = doPlayerAddItem(cid, 1993, 1) -- container =bag or backpack ID
            doAddContainerItem(Container, 2503, 1) -- item
            doAddContainerItem(Container, 2504, 1) -- item    
            doAddContainerItem(Container, 2502, 1) -- item    
            doAddContainerItem(Container, 2525, 1) -- item    
            doAddContainerItem(Container, 2435, 1) -- item    
                setPlayerStorageValue(cid,xxxx,1) -- sets storage value up 1
        else
                doPlayerSendTextMessage(cid,22,"It is empty.")
        end
        return 1
end

Line 2 == change xxxx to what number of unique id you want to have and put it on the map.
Line 3 == add the same number like line 2. (change xxxx)
Line 12 == add the same number like line 2. (change xxxx)
 
Ok it says


\data\actions\scripts/Dwarven Set.lua:18:'end'expected (to close to 'function' at line 1) near '<eof>'



Wtf? does that meanLol
 
Fixed habibas code, it probably still wont work, since your using old server o_O

Code:
function onUse(cid, item, frompos, item2, topos)
    if item.uid == xxxx then -- the unique id of chest
        queststatus = getPlayerStorageValue(cid,xxxx) --storage value, keep at chests unique id
        if queststatus == -1 then -- checks if quest is done
            doPlayerSendTextMessage(cid,22,"You have found a bag")  --Massage when open
            Container = doPlayerAddItem(cid, 1993, 1) -- container =bag or backpack ID
            doAddContainerItem(Container, 2503, 1) -- item
            doAddContainerItem(Container, 2504, 1) -- item    
            doAddContainerItem(Container, 2502, 1) -- item    
            doAddContainerItem(Container, 2525, 1) -- item    
            doAddContainerItem(Container, 2435, 1) -- item    
                setPlayerStorageValue(cid,xxxx,1) -- sets storage value up 1
        else
                doPlayerSendTextMessage(cid,22,"It is empty.")
        end
        return 1
    end
end
 
Thats what I meant. You are missing function to add items in container.

You can try to switch doAddContainerItem with doContainerAddItem, probably still wont work.
 

Similar threads

Back
Top