Harvestable
Associated namespace: sm.harvestable
Represents a harvestable object in the game.
Values:
clientPublicData[ table ]Get: (Client-Only) The harvestable's client public data.Set: (Client-Only) Sets the harvestable's client public data.
id[ int ]Get: The harvestable's id.
initialPosition[ vec3 ]Get: The harvestable's initial world position.
initialRotation[ quat ]Get: The harvestable's initial world rotation.
mass[ number ]Get: The harvestable's mass.
material[ string ]Get: The harvestable's material name.
materialId[ int ]Get: The harvestable's material id.
name[ string ]Get: The harvestable's name.
publicData[ table ]Get: (Server-Only) The harvestable's server public data.Set: (Server-Only) Sets the harvestable's server public data.
type[ string ]Get: The harvestable's type.
uuid[ uuid ]Get: The harvestable's uuid.
worldPosition[ vec3 ]Get: The harvestable's world position.
worldRotation[ quat ]Get: The harvestable's world rotation.
Operations:
| Operation | Description |
|---|---|
Harvestable == Harvestable | Checks if two instances of Harvestable refer to the same Harvestable. |
Functions
destroy
harvestable:destroy()
Server-Only
Destroys the harvestable.
Parameters:
harvestable(Harvestable): The harvestable.
getAabb
harvestable:getAabb()
Returns the bounds of the harvestable shape.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
getClientPublicData
harvestable:getClientPublicData()
Client-Only
Returns the harvestable's client public data.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (table): The public data.
getColor
harvestable:getColor()
Returns the harvestable's color.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (Color): The color.
getData
harvestable:getData()
Returns the harvestable's script data.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (table): The script data.
getId
harvestable:getId()
Returns the harvestable's id.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (int): The id.
getMass
harvestable:getMass()
Returns the harvestable's mass.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (number): The mass.
getMaterial
harvestable:getMaterial()
Returns the harvestable's material name.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (string): The material name.
getMaterialId
harvestable:getMaterialId()
Returns the harvestable's material id.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (int): The material id.
getName
harvestable:getName()
Returns the harvestable's name.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (string): The name.
getPoseWeight
harvestable:getPoseWeight( index )
Client-Only
Returns the pose weight of the pose in the given index.
Parameters:
harvestable(Harvestable): The harvestable.index(int): The index.
Returns:
- (number): The pose weight.
getPosition
harvestable:getPosition()
Returns the harvestable's world position.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (Vec3): The world position.
getPublicData
harvestable:getPublicData()
Server-Only
Returns the harvestable's server public data.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (table): The public data.
getRotation
harvestable:getRotation()
Returns the harvestable's rotation.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (Quat): The rotation.
getScale
harvestable:getScale()
Returns the harvestable's scale.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (Vec3): The scale.
getType
harvestable:getType()
Returns the harvestable's type.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (string): The type.
getUuid
harvestable:getUuid()
Returns the harvestable's uuid.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (Uuid): The uuid.
getUvFrameIndex
harvestable:getUvFrameIndex()
Client-Only
Returns the harvestable's current UV animation frame.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (int): The UV frame.
getWorld
harvestable:getWorld()
Returns the harvestable's world.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (World): The world.
hasSeat
kinematic:hasSeat()
Returns whether the kinematic has a seat component.
Parameters:
kinematic(Harvestable): The kinematic.
Returns:
- (boolean): Whether the kinematic has a seat component or not.
isKinematic
harvestable:isKinematic()
Returns whether the harvestable is a kinematic.
Parameters:
harvestable(Harvestable): The harvestable.
Returns:
- (boolean): Whether the harvestable is a kinematic or not.
setClientPublicData
harvestable:setClientPublicData( data )
Client-Only
Sets the harvestable's client public data.
Parameters:
harvestable(Harvestable): The harvestable.data(table): The data to set.
setColor
harvestable:setColor( color )
Client-Only
Sets the harvestable's color.
Parameters:
harvestable(Harvestable): The harvestable.color(Color): The color.
setParams
harvestable:setParams( data )
Server-Only
Sets the harvestable's param data.
Parameters:
harvestable(Harvestable): The harvestable.data(any): The data.
setPoseWeight
harvestable:setPoseWeight( index, value )
Client-Only
Set the pose weight of the pose in the given index.
Parameters:
harvestable(Harvestable): The harvestable.index(int): The index.value(number): The pose weight.
setPosition
kinematic:setPosition( position )
Set the harvestable's world position.
Can only be used on kinematic harvestables.
Parameters:
kinematic(Harvestable): The kinematic.position(Vec3): The world position.
setPublicData
harvestable:setPublicData( data )
Server-Only
Set the harvestable's server public data.
Parameters:
harvestable(Harvestable): The harvestable.data(table): The data to set.
setRotation
kinematic:setRotation( rotation )
Set the harvestable's rotation.
Can only be used on kinematic harvestables.
Parameters:
kinematic(Harvestable): The kinematic.rotation(Quat): The rotation.
setUvFrameIndex
harvestable:setUvFrameIndex( index )
Client-Only
Sets the UV animation frame with the given index.
Parameters:
harvestable(Harvestable): The harvestable.index(int): The index.