Hello.
There are two scripts:
1st script: Drop specific items on specific sqms on floor and open next backpack if no more items to drop;
2nd script: Move specific items to specific containers and open next backpack if no more items to drop;
It will drop the following items on the specific locations and will also open the next backpacks inside.
So you need to have a backpack with 19 items and 1 container inside, etc.
It will move items to specific containers and will also open the next backpacks inside.
So you need to have a backpack with 19 items and 1 container inside, etc.
There are two scripts:
1st script: Drop specific items on specific sqms on floor and open next backpack if no more items to drop;
2nd script: Move specific items to specific containers and open next backpack if no more items to drop;
It will drop the following items on the specific locations and will also open the next backpacks inside.
So you need to have a backpack with 19 items and 1 container inside, etc.
local OpenNextBPs = true
local ITEMS_DROP = {
{ Id = 2148, Location = { X = 12345, Y = 12345}},
{ Id = 1234, Location = { X = 12345, Y = 12345}},
{ Id = 4321, Location = { X = 12345, Y = 12345}},
}
local player_z = posz()
for _, item in ipairs(ITEMS_DROP) do
while itemcount(item.Id) > 0 do
moveitems(item.Id, ground(item.Location.X, item.Location.Y, player_z), '', 100)
end
end
if OpenNextBPs then
local containers = getcontainers()
for i = 1, #containers do
local container = containers[i]
for j = 1, #container.items do
local item = container.items[j]
if item ~= nil then
if itemhasflags(item.id, 4) then
openitemslot(item.index, container.index, false)
wait(800, 1200)
break
end
end
end
end
end
It will move items to specific containers and will also open the next backpacks inside.
So you need to have a backpack with 19 items and 1 container inside, etc.
local OpenNextBPs = true
local ITEMS_FROM_CONTAINER = 0 -- Index or container name. I recommend to use index because you may have many backpacks.
local ITEMS_DROP = {
{ Id = 2148, Location = { X = 12345, Y = 12345}},
{ Id = 1234, Location = { X = 12345, Y = 12345}},
{ Id = 4321, Location = { X = 12345, Y = 12345}},
}
local player_z = posz()
for _, item in ipairs(ITEMS_DROP) do
while itemcount(item.Id, ITEMS_FROM_CONTAINER) > 0 do
moveitems(item.Id, ground(item.Location.X, item.Location.Y, player_z), ITEMS_FROM_CONTAINER, 100)
end
end
if OpenNextBPs then
local containers = getcontainers()
local container_from_name = ''
local container_from_index = -1
if type(ITEMS_FROM_CONTAINER) == 'number' then
container_from_index = ITEMS_FROM_CONTAINER
elseif type(ITEMS_FROM_CONTAINER) == 'string' then
local temp_num = tonumber(ITEMS_FROM_CONTAINER)
if temp_num ~= nil then
container_from_index = temp_num
else
container_from_name = ITEMS_FROM_CONTAINER
end
end
for i = 1, #containers do
local container = containers[i]
if container.open and container.usedslots > 0 and (container.name == container_from_name or container.index == container_from_index) then
for j = 1, #container.items do
local item = container.items[j]
if item ~= nil then
if itemhasflags(item.id, 4) then
openitemslot(item.index, container.index, false)
wait(800, 1200)
break
end
end
end
end
end
end