Hello.
The script on the link you posted works just fine. If the script is not moving items, so your BackpackLoot variable may have a bad value.
But i've changed it little bit. Try this code:
local ItemsDrop = { 'dwarven shield', 'battle shield', 'halberd', 'wooden shield' } -- Items that you wanna drop inside the container.
local BackpackLoot = 'Red Backpack' -- Backpack that you are carrying to keep loots, it will drop FROM this backpack.
local DropBagPosition = { X = 12345, Y = 54321, Z = 6 } -- Container's location that you wanna open and drop items inside.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
if getOpenedContainer == nil then
function getOpenedContainer(containersBefore, containersAfter)
if containersAfter ~= nil and containersBefore ~= nil then
for _, contAfter in ipairs(containersAfter) do
local flag = false
for __, contBefore in ipairs(containersBefore) do
if contAfter.index == contBefore.index then
flag = true
break
end
end
if not flag then
return contAfter
end
end
end
return nil
end
end
local containersBefore = getcontainers()
local bagContainer = nil
for i = 0, 5 do
openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
wait(1000, 1200)
bagContainer = getOpenedContainer(containersBefore, getcontainers())
if bagContainer ~= nil then
break
end
end
if bagContainer ~= nil then
table.id(ItemsDrop)
if tempOpenNextContainer == nil then
function tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots > 0 then
while bagContainer.maxslots == bagContainer.usedslots and bagContainer.maxslots > 0 do
local foundContainer = false
for _, bagItem in ipairs(bagContainer.items) do
if itemhasflags(bagItem.id, 4) then
foundContainer = true
openitem(bagItem.id, bagContainer.index)
wait(1200, 1500)
bagContainer = getcontainer(bagContainer.index)
break
end
end
if foundContainer == false then
break
end
end
end
return bagContainer
end
end
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft > 0 then
for _, item in ipairs(ItemsDrop) do
while itemcount(item, BackpackLoot) > 0 do
if emptyLeft == 0 then
bagContainer = tempOpenNextContainer(getcontainer(bagContainer.index))
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft == 0 then
break
end
end
end
moveitems(item, bagContainer.index, BackpackLoot, 100)
wait(300)
emptyLeft = emptyLeft - 1
end
end
end
end
end