IF THERE IS NO SPACE IN THE CONTAINER'S BACKPACK AND IN THE SET AND IN THE INVENTORY WHEN USED IN THE CHEST, IT WILL BE SENT FOR DEPOSIT CITY NAME DexSoft id 1
Lua:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 1624 then
if getPlayerStorageValue(cid, 1624) == -1 then
if getPlayerLevel(cid) >= 0 then
-- Adds backpacks with ID 10518 to the player's inventory
for i = 1, 42 do
if not doPlayerAddItem(cid, 10518, 1) then
doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
return true
end
end
-- Adds 1000 coins (ID 2159) inside a backpack (ID 10518) and repeats 100 times
for i = 1, 100 do
local backpack = doCreateItemEx(10518, 1)
if backpack ~= 0 then
for j = 1, 42 do
doAddContainerItem(backpack, 2159, 1000)
end
doPlayerAddItemEx(cid, backpack, false)
else
doPlayerSendCancel(cid, "You don't have enough space for the backpacks.")
return true
end
end
else
-- If player level requirement not met
doPlayerSendCancel(cid, "You don't have the required level to use this item.")
end
else
-- If storage value not equal to -1
doPlayerSendCancel(cid, "You have already used this item.")
end
end
end
Last edited: