this action she opens the backpack but does not play items inside
local ItemsDrop = { 'fish', 'battle shield', '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 = 7 } -- Container's location that you wanna open and drop items inside.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
local startWindowsCount = windowcount()
local currentWindowsCount = -1
for i = 0, 5 do
openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
wait(1000)
currentWindowsCount = windowcount()
if currentWindowsCount > startWindowsCount then
break
end
end
if currentWindowsCount > startWindowsCount then
table.id(ItemsDrop)
local bagIndex = currentWindowsCount - 1
local bagContainer = getcontainer(bagIndex)
function tempOpenNextContainer(bagContainer)
local emptyLeft = bagContainer.maxslots - bagContainer.usedslots
while emptyLeft == 0 do
for _, bagItem in ipairs(bagContainer.items) do
if itemhasflags(bagItem.id, 4) then
openitem(bagItem.id, bagContainer.index)
wait(1000)
bagContainer = getcontainer(bagContainer.index)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
break
else
return
end
end
emptyLeft = -1
end
end
if emptyLeft > 0 then
return bagContainer
else
return nil
end
end
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft > 0 then
for i,j in ipairs(ItemsDrop) do
if table.find(ItemsDrop, j) ~= nil then
while itemcount(j, BackpackLoot) > 0 do
if emptyLeft == 0 then
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
end
end
moveitems(j, bagContainer.index, BackpackLoot, 100)
wait(300)
emptyLeft = emptyLeft - 1
end
end
end
end
end
end
local ItemsDrop = { 'fish', 'battle shield', '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 = 7 } -- Container's location that you wanna open and drop items inside.
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ CREDITS TO ARKILYS --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
--[[ DON'T EDIT BELOW THIS LINE --]]
local startWindowsCount = windowcount()
local currentWindowsCount = -1
for i = 0, 5 do
openitem(0, ground(DropBagPosition.X, DropBagPosition.Y, DropBagPosition.Z), true)
wait(1000)
currentWindowsCount = windowcount()
if currentWindowsCount > startWindowsCount then
break
end
end
if currentWindowsCount > startWindowsCount then
table.id(ItemsDrop)
local bagIndex = currentWindowsCount - 1
local bagContainer = getcontainer(bagIndex)
function tempOpenNextContainer(bagContainer)
local emptyLeft = bagContainer.maxslots - bagContainer.usedslots
while emptyLeft == 0 do
for _, bagItem in ipairs(bagContainer.items) do
if itemhasflags(bagItem.id, 4) then
openitem(bagItem.id, bagContainer.index)
wait(1000)
bagContainer = getcontainer(bagContainer.index)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
break
else
return
end
end
emptyLeft = -1
end
end
if emptyLeft > 0 then
return bagContainer
else
return nil
end
end
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
if emptyLeft > 0 then
for i,j in ipairs(ItemsDrop) do
if table.find(ItemsDrop, j) ~= nil then
while itemcount(j, BackpackLoot) > 0 do
if emptyLeft == 0 then
bagContainer = tempOpenNextContainer(bagContainer)
if bagContainer ~= nil and bagContainer.maxslots ~= nil then
emptyLeft = bagContainer.maxslots - bagContainer.usedslots
end
end
moveitems(j, bagContainer.index, BackpackLoot, 100)
wait(300)
emptyLeft = emptyLeft - 1
end
end
end
end
end
end