sm.harvestable
Associated object type: Harvestable
A Harvestable is a static game object, usually representing things that can be harvested, such as trees or planted crops.
This library provides methods for creating and interacting with them.
Functions
create
local hvs = sm.harvestable.create(uuid, position, rotation, slopeNormal)
Server-Only
Creates a new Harvestable.
note
For naming consistency reasons, createHarvestable was added after this one.
While both functions do the same thing, createHarvestable should be preferred due to this.
Parameters:
uuid(Uuid): The UUID of the harvestable.position(Vec3): The harvestable's world position.rotation(Quat): The harvestable's world rotation. Defaults tosm.quat.identity().slopeNormal(Vec3): The harvestable's slope normal, for "skew" and "rotate" slope settings. Defaults to Z axis.
Returns:
hvs(Harvestable): The created harvestable.
createHarvestable
sm.harvestable.createHarvestable(uuid, position, rotation, slopeNormal)
Server-Only
Creates a new Harvestable.
Parameters:
uuid(Uuid): The UUID of the harvestable.position(Vec3): The harvestable's world position.rotation(Quat): The harvestable's world rotation. Defaults tosm.quat.identity().slopeNormal(Vec3): The harvestable's slope normal, for "skew" and "rotate" slope settings. Defaults to Z axis.
Returns:
hvs(Harvestable): The created harvestable.