Log in

View Full Version : Script to use and drop piggy banks



kae
06-02-2016, 11:16 PM
Hi there,

I'm looking for a script to use piggy banks, and once broken, drops them. Thanks in advance

Tirell
06-03-2016, 12:22 AM
Module.New("Use&Drop", function(Piggy)
local cont = Container.GetFirst()
while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == 2995) then
if (item.count > 0) then
cont:UseItem(spot)
end
end
end
cont = cont:GetNext()
end
if (Self.ItemCount(2996) > 0) then
Self.DropItems(Self.Position().x, Self.Position().y, Self.Position().z, 2996)
end
Piggy:Delay(2000)
end)

kae
06-03-2016, 12:53 AM
Module.New("Use&Drop", function(Piggy)
local cont = Container.GetFirst()
while (cont:isOpen()) do
for spot = 0, cont:ItemCount() do
local item = cont:GetItemData(spot)
if (item.id == 2995) then
if (item.count > 0) then
cont:UseItem(spot)
end
end
end
cont = cont:GetNext()
end
if (Self.ItemCount(2996) > 0) then
Self.DropItems(Self.Position().x, Self.Position().y, Self.Position().z, 2996)
end
Piggy:Delay(2000)
end)[/QUOTE]

Wow that was quick! Thank you kind sir :D