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
  • createPart
  • createWedge
  • getShapeDescription
  • getShapeIcon
  • getShapeTitle
  • getShapeTypeColor
  • uuidExists

  • sm.shape.createBlock(uuid, size, position, rotation=nil, dynamic=true, forceSpawn=true)

    Server only

    Create a new block

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    Vec3sizeThe size of the block.
    Vec3positionThe shape's world position.
    Quatrotation=nilThe shape's world rotation. Defaults to no rotation (Optional)
    booleandynamic=trueSet true if the shape is dynamic or false if the shape is static. Defaults to true (Optional)
    booleanforceSpawn=trueSet true to force spawn the shape even if it will cause collision. Defaults to true (Optional)

    Returns:

    TypeDescription
    Shape The created block

    sm.shape.createPart(uuid, position, rotation, dynamic=true, forceSpawn=true)

    Server only

    Create a new part

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    Vec3positionThe shape's world position.
    QuatrotationThe shape's world rotation. Defaults to no rotation (Optional)
    booleandynamic=trueSet true if the shape is dynamic or false if the shape is static. Defaults to true (Optional)
    booleanforceSpawn=trueSet true to force spawn the shape even if it will cause collision. Defaults to true (Optional)

    Returns:

    TypeDescription
    Shape The created part

    sm.shape.createWedge(uuid, size, position, rotation=nil, dynamic=true, forceSpawn=true)

    Server only

    Creates a wedge. The wedge is oriented with one

    cathetus along the Y-axis and the other along the Z-axis, forming a right angle.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.
    Vec3sizeThe size of the wedge.
    Vec3positionThe shape's world position.
    Quatrotation=nilThe shape's world rotation. Defaults to no rotation (Optional)
    booleandynamic=trueSet true if the shape is dynamic or false if the shape is static. Defaults to true (Optional)
    booleanforceSpawn=trueSet true to force spawn the shape even if it will cause collision. Defaults to true (Optional)

    Returns:

    TypeDescription
    Shape The created wedge

    sm.shape.getShapeDescription(uuid)

    Returns the block/part description for the given uuid.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid.

    Returns:

    TypeDescription
    stringThe shape description.

    sm.shape.getShapeIcon(uuid)

    Parameters:

    TypeNameDescription
    UuiduuidThe shape's uuid.

    Returns:

    TypeDescription
    anyThe shape's icon.

    sm.shape.getShapeTitle(uuid)

    Returns the block/part name for the given uuid.

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid.

    Returns:

    TypeDescription
    stringThe shape title.

    sm.shape.getShapeTypeColor(uuid)

    Returns the color of the uuid's shape type

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the shape.

    Returns:

    TypeDescription
    ColorThe color of the shape type.

    sm.shape.uuidExists(The)

    Return whether the shape uuid exists

    Parameters:

    TypeNameDescription
    UuidTheshape uuid.

    Returns:

    TypeDescription
    booleanexists.