sm.harvestable
Associated object type: Harvestable
Harvestable creation
Functions:
create createHarvestable getAllHarvestables getKinematicByInitialHash
sm.harvestable.create(uuid, position, rotation?, slopeNormal?)
Deprecated:
Use createHarvestable instead
Create a new harvestable
Parameters:
| Type | Name | Description |
| Uuid | uuid | The uuid of the harvestable. |
| Vec3 | position | The harvestable's world position. |
| Quat | rotation? | The harvestable's world rotation, optional uses identity rotation if nil. |
| Vec3 | slopeNormal? | The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil. |
Returns:
sm.harvestable.createHarvestable(uuid, position, rotation?, slopeNormal?, world?)
Server only
Create a new harvestable
Parameters:
| Type | Name | Description |
| Uuid | uuid | The uuid of the harvestable. |
| Vec3 | position | The harvestable's world position. |
| Quat | rotation? | The harvestable's world rotation, optional uses identity rotation if nil. |
| Vec3 | slopeNormal? | The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil. |
| World | world? | The world to create the harvestable in. Defaults to the world of the script. |
Returns:
sm.harvestable.getAllHarvestables(world?)
Returns a table with all the harvestables in the world.
Parameters:
| Type | Name | Description |
| World | world? | The world, will default to the script's world. (optional) |
Returns:
| Type | Description |
| table | The table of all harvestables. {Harvestable, ..} |
sm.harvestable.getKinematicByInitialHash(initialHash)
Gets a kinematic matching the provided initial hash if it exists.
Parameters:
| Type | Name | Description |
| number | initialHash | The initial hash to search for. |
Returns:
| Type | Description |
| Harvestable The kinematic if it exists. | |