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.
Operation | Description |
---|---|
Harvestable == Harvestable | Checks if two instances of Harvestable refer to the same Harvestable . |
Functions
destroy
harvestable:destroy()
Server-Only
Destroys the harvestable.
Arguments:harvestable
[ Harvestable ]: The harvestable.
getAabb
harvestable:getAabb()
Returns the bounds of the harvestable shape.
Arguments:harvestable
[ Harvestable ]: The harvestable.
getClientPublicData
harvestable:getClientPublicData()
Client-Only
Returns the harvestable's client public data.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ table ]: The public data.
getColor
harvestable:getColor()
Returns the harvestable's color.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ Color ]: The color.
getData
harvestable:getData()
Returns the harvestable's script data.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ table ]: The script data.
getId
harvestable:getId()
Returns the harvestable's id.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ int ]: The id.
getMass
harvestable:getMass()
Returns the harvestable's mass.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ number ]: The mass.
getMaterial
harvestable:getMaterial()
Returns the harvestable's material name.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ string ]: The material name.
getMaterialId
harvestable:getMaterialId()
Returns the harvestable's material id.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ int ]: The material id.
getName
harvestable:getName()
Returns the harvestable's name.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ 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.
- [ number ]: The pose weight.
getPosition
harvestable:getPosition()
Returns the harvestable's world position.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ Vec3 ]: The world position.
getPublicData
harvestable:getPublicData()
Server-Only
Returns the harvestable's server public data.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ table ]: The public data.
getRotation
harvestable:getRotation()
Returns the harvestable's rotation.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ Quat ]: The rotation.
getScale
harvestable:getScale()
Returns the harvestable's scale.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ Vec3 ]: The scale.
getSeatCharacter
kinematic:getSeatCharacter()
Returns the Character that is seated in the kinematic.
Arguments:kinematic
[ Harvestable ]: The kinematic.
- [ Character ]: The character.
getType
harvestable:getType()
Returns the harvestable's type.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ string ]: The type.
getUuid
harvestable:getUuid()
Returns the harvestable's uuid.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ Uuid ]: The uuid.
getUvFrameIndex
harvestable:getUvFrameIndex()
Client-Only
Returns the harvestable's current UV animation frame.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ int ]: The UV frame.
getWorld
harvestable:getWorld()
Returns the harvestable's world.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ World ]: The world.
hasSeat
kinematic:hasSeat()
Returns whether the kinematic has a seat component.
Arguments:kinematic
[ Harvestable ]: The kinematic.
- [ bool ]: Whether the kinematic has a seat component or not.
isKinematic
harvestable:isKinematic()
Returns whether the harvestable is a kinematic.
Arguments:harvestable
[ Harvestable ]: The harvestable.
- [ 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:harvestable
[ Harvestable ]: The harvestable.color
[ Color ]: The color.
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.
kinematic
[ Harvestable ]: The kinematic.position
[ Vec3 ]: The world position.
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.
kinematic
[ Harvestable ]: The kinematic.rotation
[ Quat ]: The rotation.
setSeatCharacter
kinematic:setSeatCharacter( character )
Requests to seat a Character in the kinematic.
Arguments:kinematic
[ Harvestable ]: The kinematic.character
[ Character ]: The character.
setUvFrameIndex
harvestable:setUvFrameIndex( index )
Client-Only
Sets the UV animation frame with the given index.
Arguments:harvestable
[ Harvestable ]: The harvestable.index
[ int ]: The index.