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 getShapeDescription getShapeIcon getShapeTitle getShapeTypeColor uuidExists
sm.shape.createBlock(uuid, size, position, rotation=nil, dynamic=true, forceSpawn=true)
Server only
Create a new block
Parameters:
Type | Name | Description |
Uuid | uuid | The uuid of the shape. |
Vec3 | size | The size of the block. |
Vec3 | position | The shape's world position. |
Quat | rotation=nil | The shape's world rotation. Defaults to no rotation (Optional) |
boolean | dynamic=true | Set true if the shape is dynamic or false if the shape is static. Defaults to true (Optional) |
boolean | forceSpawn=true | Set true to force spawn the shape even if it will cause collision. Defaults to true (Optional) |
Returns:
Type | Description |
Shape The created block | |
sm.shape.createPart(uuid, position, rotation, dynamic=true, forceSpawn=true)
Server only
Create a new part
Parameters:
Type | Name | Description |
Uuid | uuid | The uuid of the shape. |
Vec3 | position | The shape's world position. |
Quat | rotation | The shape's world rotation. Defaults to no rotation (Optional) |
boolean | dynamic=true | Set true if the shape is dynamic or false if the shape is static. Defaults to true (Optional) |
boolean | forceSpawn=true | Set true to force spawn the shape even if it will cause collision. Defaults to true (Optional) |
Returns:
Type | Description |
Shape The created part | |
sm.shape.getShapeDescription(uuid)
Returns the block/part description for the given uuid.
Parameters:
Type | Name | Description |
Uuid | uuid | The uuid. |
Returns:
Type | Description |
string | The shape description. |
sm.shape.getShapeIcon(uuid)
Parameters:
Type | Name | Description |
Uuid | uuid | The shape's uuid. |
Returns:
Type | Description |
any | The shape's icon. |
sm.shape.getShapeTitle(uuid)
Returns the block/part name for the given uuid.
Parameters:
Type | Name | Description |
Uuid | uuid | The uuid. |
Returns:
Type | Description |
string | The shape title. |
sm.shape.getShapeTypeColor(uuid)
Returns the color of the uuid's shape type
Parameters:
Type | Name | Description |
Uuid | uuid | The uuid of the shape. |
Returns:
Type | Description |
Color | The color of the shape type. |
sm.shape.uuidExists(The)
Return whether the shape uuid exists
Parameters:
Type | Name | Description |
Uuid | The | shape uuid. |
Returns:
Type | Description |
boolean | exists. |