Skip to main content

PowerCell

Stores electricity, and is used to power many devices using wires or by directly attaching it. Has a maximum capacity of 200000.

It is a craftable and spawnable 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 (2x2x2) it has a durability of 1, at its maximum size it has a durability of 5.

By default, its colour is #646464.

It requires 1 Iron, 1 Sulfur, and 1 Wire 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

warning

This method is deprecated. Use :GetResourceAmount() instead.

Gives you the total amount of objects in the container.

The amount return is a number.

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, or Fluid
  • The resourceAmount parameter is a number.