Skip to main content

sm.shape

Associated object type: Shape

A shape is any block, part or basic material that can be built by a player.
Shapes are always connected to a body, which is a collection of shapes.

For more information about creating your own scripted shapes, see ShapeClass.

Functions

createBlock

sm.shape.createBlock( uuid, size, position, rotation, dynamic, forceSpawn )
Server-Only

Creates a new block.

Arguments:
  • uuid [ Uuid ]: The block uuid.
  • size [ Vec3 ]: The block size.
  • position [ Vec3 ]: The the world position.
  • rotation [ Quat ]: The world rotation (defaults to none).
  • dynamic [ bool ]: Whether the shape is dynamic or static. Defaults to true (dynamic).
  • forceSpawn [ bool ]: Whether to force spawn the shape or not. Optional.
Returns:

createPart

sm.shape.createPart( uuid, position, rotation, dynamic, forceSpawn )
Server-Only

Creates a new part.

Arguments:
  • uuid [ Uuid ]: The part uuid.
  • position [ Vec3 ]: The the world position.
  • rotation [ Quat ]: The world rotation (defaults to none).
  • dynamic [ bool ]: Whether the shape is dynamic or static. Defaults to true (dynamic).
  • forceSpawn [ bool ]: Whether to force spawn the shape or not. Optional.
Returns:

getShapeDescription

sm.shape.getShapeDescription( uuid )

Returns the item description for the given uuid.

Arguments:
  • uuid [ Uuid ]: The item uuid.
Returns:
  • [ string ]: The description.

getShapeIcon

sm.shape.getShapeIcon( uuid )

[Missing Description]

Arguments:
  • uuid [ Uuid ]: The item uuid.
Returns:
  • [ any ]: The shape's icon.

getShapeTitle

sm.shape.getShapeTitle( uuid )

Returns the item's name for the given uuid.

Arguments:
  • uuid [ Uuid ]: The item uuid.
Returns:
  • [ string ]: The shape's name.

getShapeTypeColor

sm.shape.getShapeTypeColor( uuid )

Returns the color of the uuid's shape type.

Arguments:
  • uuid [ Uuid ]: The item uuid.
Returns:
  • [ Color ]: The color of the shape type.

getIsHarvest

sm.shape.getIsHarvest( uuid )

Returns whether the uuid belongs to a harvestable shape.

Arguments:
  • uuid [ Uuid ]: The item uuid.
Returns:
  • [ bool ]: Whether the shape is harvestable or not.

uuidExists

sm.shape.uuidExists( uuid )

Returns whether the shape uuid exists.

Arguments:
  • uuid [ Uuid ]: The shape uuid.
Returns:
  • [ bool ]: Whether the uuid exists or not.