Hars
11-15-2015, 07:17 AM
Hello,
I need some your help in script. I'm using script for moving bolts to ammo bp, working very well but when Im out of bolts that script made freezes and I must kill script and everything back to normal.
ArrowBp = "Brocade Backpack"
ArrowID = Item.GetID("prismatic bolt")
while true do
if (Self.ItemCount(ArrowID) >= 1) then
local MainBp = Container.GetFirst()
local DestinationBp = Container.GetByName(ArrowBp)
for spot = 0, MainBp:ItemCount() do
local item = MainBp:GetItemData(spot)
if (item.id == ArrowID) then
MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
wait(500)
break
end
wait(200)
end
end
end
What is wrong with it?
I need some your help in script. I'm using script for moving bolts to ammo bp, working very well but when Im out of bolts that script made freezes and I must kill script and everything back to normal.
ArrowBp = "Brocade Backpack"
ArrowID = Item.GetID("prismatic bolt")
while true do
if (Self.ItemCount(ArrowID) >= 1) then
local MainBp = Container.GetFirst()
local DestinationBp = Container.GetByName(ArrowBp)
for spot = 0, MainBp:ItemCount() do
local item = MainBp:GetItemData(spot)
if (item.id == ArrowID) then
MainBp:MoveItemToContainer(spot, DestinationBp:Index(), 0)
wait(500)
break
end
wait(200)
end
end
end
What is wrong with it?