Skip to main content

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:
OperationDescription
Harvestable == HarvestableChecks if two instances of Harvestable refer to the same Harvestable.

Functions

destroy

harvestable:destroy()
Server-Only

Destroys the harvestable.

Arguments:

getAabb

harvestable:getAabb()

Returns the bounds of the harvestable shape.

Arguments:
Returns:

getClientPublicData

harvestable:getClientPublicData()
Client-Only

Returns the harvestable's client public data.

Arguments:
Returns:
  • [ table ]: The public data.

getColor

harvestable:getColor()

Returns the harvestable's color.

Arguments:
Returns:

getData

harvestable:getData()

Returns the harvestable's script data.

Arguments:
Returns:
  • [ table ]: The script data.

getId

harvestable:getId()

Returns the harvestable's id.

Arguments:
Returns:
  • [ int ]: The id.

getMass

harvestable:getMass()

Returns the harvestable's mass.

Arguments:
Returns:
  • [ number ]: The mass.

getMaterial

harvestable:getMaterial()

Returns the harvestable's material name.

Arguments:
Returns:
  • [ string ]: The material name.

getMaterialId

harvestable:getMaterialId()

Returns the harvestable's material id.

Arguments:
Returns:
  • [ int ]: The material id.

getName

harvestable:getName()

Returns the harvestable's name.

Arguments:
Returns:
  • [ string ]: The name.

getPoseWeight

harvestable:getPoseWeight( index )
Client-Only

Returns the pose weight of the pose in the given index.

Arguments:
  • harvestable [ Harvestable ]: The harvestable.
  • index [ int ]: The index.
Returns:
  • [ number ]: The pose weight.

getPosition

harvestable:getPosition()

Returns the harvestable's world position.

Arguments:
Returns:
  • [ Vec3 ]: The world position.

getPublicData

harvestable:getPublicData()
Server-Only

Returns the harvestable's server public data.

Arguments:
Returns:
  • [ table ]: The public data.

getRotation

harvestable:getRotation()

Returns the harvestable's rotation.

Arguments:
Returns:

getScale

harvestable:getScale()

Returns the harvestable's scale.

Arguments:
Returns:

getSeatCharacter

kinematic:getSeatCharacter()

Returns the Character that is seated in the kinematic.

Arguments:
Returns:

getType

harvestable:getType()

Returns the harvestable's type.

Arguments:
Returns:
  • [ string ]: The type.

getUuid

harvestable:getUuid()

Returns the harvestable's uuid.

Arguments:
Returns:

getUvFrameIndex

harvestable:getUvFrameIndex()
Client-Only

Returns the harvestable's current UV animation frame.

Arguments:
Returns:
  • [ int ]: The UV frame.

getWorld

harvestable:getWorld()

Returns the harvestable's world.

Arguments:
Returns:

hasSeat

kinematic:hasSeat()

Returns whether the kinematic has a seat component.

Arguments:
Returns:
  • [ bool ]: Whether the kinematic has a seat component or not.

isKinematic

harvestable:isKinematic()

Returns whether the harvestable is a kinematic.

Arguments:
Returns:
  • [ bool ]: Whether the harvestable is a kinematic or not.

setClientPublicData

harvestable:setClientPublicData( data )
Client-Only

Sets the harvestable's client public data.

Arguments:
  • harvestable [ Harvestable ]: The harvestable.
  • data [ table ]: The data to set.

setColor

harvestable:setColor( color )
Client-Only

Sets the harvestable's color.

Arguments:

setParams

harvestable:setParams( data )
Server-Only

Sets the harvestable's param data.

Arguments:
  • 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.

Arguments:
  • 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.

Arguments:

setPublicData

harvestable:setPublicData( data )
Server-Only

Set the harvestable's server public data.

Arguments:
  • 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.

Arguments:

setSeatCharacter

kinematic:setSeatCharacter( character )

Requests to seat a Character in the kinematic.

Arguments:

setUvFrameIndex

harvestable:setUvFrameIndex( index )
Client-Only

Sets the UV animation frame with the given index.

Arguments:
  • harvestable [ Harvestable ]: The harvestable.
  • index [ int ]: The index.