Bin
Stores solid items such as Aluminum
, Iron
, Faucet
s, etc.
Can store up to 1,000 items. When destroyed, every item inside will also be destroyed.
The value increases as more items are added to it.
Bins can also be used as crafting recipes, with the resources inside being used. You can also configure a bin to prevent items from being crafted from it, allowing for bins to be strictly for machine storage.
It is a craftable and spawnable non-flammable solid.
Here is a list of possible sizes that reach the maximum malleability (1000) that have integer components: 1x1000x1, 1x500x2, 1x250x4, 1x200x5, 1x125x8, 1x100x10, 1x50x20, 1x40x25, 2x250x2, 2x125x4, 2x100x5, 2x50x10, 2x25x20, 4x50x5, 4x25x10, 5x40x5, 5x25x8, 5x20x10, 10x10x10, 20x10x5, 25x20x2, 25x10x4, 25x8x5
At its default size (4x4x4) it has a durability of 12, at its maximum size it has a durability of 31.
By default, its colour is #ffffff.
It requires 3 Iron
, to be crafted.
Methods
GetResource() → resource
Gets the name of the resource contained, will return the string "nil"
if nothing is stored, rather than actually returning nil
.
The resource return can be any of the following types:
-
string
-
"nil"
GetResourceAmount() → amount
Gives you the total amount of objects in the container.
The amount return is a number
.
GetAmount() → amount
This method is deprecated. Use :GetResourceAmount()
instead.
Gives you the total amount of objects in the container.
The amount return is a number
.
Configurables
CanBeCraftedFrom
Determines whether this bin can be used by nearby players to craft objects. It is a boolean
.
Resource
The kind of resource the bin can hold. You can set this to Any to allow the bin to accept anything. It is a string
.
Events
ContainerChanged(resourceType, resourceAmount)
Fires when the amount of the resource in the container changes.
The parameters for ContainerChanged
are as follows:
- The resourceType parameter is a string that can be
Power
,Solid
, orFluid
- The resourceAmount parameter is a
number
.
OnClick(clickerId)
Fires when the object is clicked.
The clickerId parameter is the UserId
of the player who clicked the object. It is a number
.