sm.harvestable

Harvestable creation

Server + Client

create

sm.harvestable.create( uuid, position, rotation, slopeNormal )

Deprecated: Use createHarvestable instead

Create a new harvestable

Parameters:

Name Type Description
uuid Uuid The uuid of the harvestable.
position Vec3 The harvestable's world position.
rotation (optional) Quat The harvestable's world rotation, optional uses identity rotation if nil.
slopeNormal (optional) Vec3 The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil.

Returns:

Type Description
Harvestable The created harvestable.

getAllHarvestables

sm.harvestable.getAllHarvestables( world )

Returns a table with all the harvestables in the world.

Parameters:

Name Type Description
world (optional) World The world, will default to the script's world. (optional)

Returns:

Type Description
table The table of all harvestables. {Harvestable, ..}

getKinematicByInitialHash

sm.harvestable.getKinematicByInitialHash( initialHash )

Gets a kinematic matching the provided initial hash if it exists.

Parameters:

Name Type Description
initialHash number The initial hash to search for.

Returns:

Type Description
Harvestable The kinematic if it exists.

Server-only

createHarvestable

sm.harvestable.createHarvestable(
    uuid,
    position,
    rotation,
    slopeNormal,
    world
)

Create a new harvestable

Parameters:

Name Type Description
uuid Uuid The uuid of the harvestable.
position Vec3 The harvestable's world position.
rotation (optional) Quat The harvestable's world rotation, optional uses identity rotation if nil.
slopeNormal (optional) Vec3 The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil.
world (optional) World The world to create the harvestable in. Defaults to the world of the script.

Returns:

Type Description
Harvestable The created harvestable.