Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- AntiTrash = Module("Anti-Trash", function(mod)
- if Casino_Started then
- local die_count = 0
- x = Self.Position().x
- y = Self.Position().y
- z = Self.Position().z
- local deco_count = 0
- local posx, posy, posz = 0, 0, 0
- for _, die in ipairs(Dice_IDs) do
- die_count = die_count + Container_Index.Locker:CountItemsOfID(die)
- end
- for i, deco in pairs(_Decoration_Items) do
- deco_count = deco_count + Container_Index.Locker:CountItemsOfID(Item.GetID(deco))
- end
- for i = Container_Index.Locker:ItemCount() - 1, 0, -1 do
- local Spot = Container_Index.Locker:GetItemData(i)
- posx, posy, posz = Positions.Counter_Pos.x, Positions.Counter_Pos.y, Positions.Counter_Pos.z
- if Spot.id == 3043 then
- wait(100)
- Container_Index.Locker:MoveItemToGround(i, posx, posy, posz, Spot.count)
- end
- if die_count > 1 and table.contains(Dice_IDs, Spot.id) and 1 < CountItemsOfIDs(Container_Index.Locker, {
- 5792,
- 5793,
- 5794,
- 5795,
- 5796,
- 5797
- }) then
- print("Movendo " .. Item.GetName(Spot.id) .. " " .. Spot.count .. "x.")
- Container_Index.Locker:MoveItemToContainer(i, Container_Index.Trash:Index(), Container_Index.Trash:ItemCapacity() - 1, Spot.count)
- die_count = die_count - 1
- elseif deco_count > #_Decoration_Items and table.contains(_Decoration_Items, Item.GetName(Spot.id)) then
- print("Movendo " .. Item.GetName(Spot.id) .. " " .. Spot.count .. "x.")
- Container_Index.Locker:MoveItemToContainer(i, Container_Index.Trash:Index(), Container_Index.Trash:ItemCapacity() - 1, Spot.count)
- deco_count = deco_count - 1
- end
- end
- for i = 0, Container_Index.Locker:ItemCount() - 1 do
- local Spot = Container_Index.Locker:GetItemData(i)
- if not table.contains(Depot_IDs, Spot.id) and not table.contains(_Decoration_Items, Item.GetName(Spot.id)) and not table.contains(Dice_IDs, Spot.id) then
- Container_Index.Locker:MoveItemToGround(2, x, y, z, 100)
- break
- end
- end
- end
- mod:Delay(Self.Ping())
- end, false)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement