Assembler
Assembles items as configured when the structure is supplied with the required power and resources.
It is a craftable and spawnable non-flammable solid.
It cannot be resized.
At its default size (8x8x8) it has a durability of 1.
By default, its colour is #5a4c42.
It requires 3 Gear
, 2 Iron
, and 2 Wire
to be crafted.
Methods
CalculateCraftingRecipe(items) → recipe
Returns the ingredients (including Power
), products, and time cost of a specified crafting operation.
The items parameter is a list of parts or a dictionary of each part with how many of said part to craft. It can be any of the following types:
-
{ string }
-
{ [string]: number }
The recipe return is information relating to the crafting recipe. It is a dictionary with keys that are string
s and values that are number
s.
Craft(itemName) → success
Will pause and craft the desired item at the next available point, returning a boolean representing whether or not the item was successfully crafted.
This uses a queue under the hood, the first thing to call it gets to craft first, and then finally the assembler performs its configured craft if nothing else is queued.
The itemName parameter is a string
.
The success return is a boolean
.
GetCraftCooldown() → craftCooldown
How long until the assembler can craft again.
The craftCooldown return is a number
.
GetRecipe(itemName) → recipe
Returns the resource(s) required to craft the given item, or nil if the item doesn't have a recipe/doesn't exist.
The itemName parameter is a string
.
The recipe return is a dictionary with keys that are string
s and values that are number
s.
CraftItems(items)
This method is deprecated.
Will craft the specified set of items.
The items parameter can be any of the following types:
-
{ string }
-
{ [string]: number }
GetInventory() → inventory
This method is deprecated. Returns an empty, frozen table.
The inventory return is a dictionary with keys that are string
s and values that are number
s.
Configurables
Assemble
The name of the object to be assembled. It is a string
.
Events
Configured(configurerId)
Fires when the object is configured.
The configurerId parameter is the UserId
of the player who configured the object. It is a number
.
Loop(deltaTime)
Fires when the object is updated by the game loop.
The deltaTime parameter is the 'time' since the last tick, it does not represent the actual time since the last tick was occurred, rather just how often a game tick should be fired (it will always be precisely 1
). It is a number
.