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:

    TypeNameDescription
    UuiduuidThe uuid of the harvestable.
    Vec3positionThe harvestable's world position.
    Quatrotation?The harvestable's world rotation, optional uses identity rotation if nil.
    Vec3slopeNormal?The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil.

    Returns:

    TypeDescription
    HarvestableThe created harvestable.

    sm.harvestable.createHarvestable(uuid, position, rotation?, slopeNormal?, world?)

    Server only

    Create a new harvestable

    Parameters:

    TypeNameDescription
    UuiduuidThe uuid of the harvestable.
    Vec3positionThe harvestable's world position.
    Quatrotation?The harvestable's world rotation, optional uses identity rotation if nil.
    Vec3slopeNormal?The harvestable's slope normal. For "skew" and "rotate" slope settings, optional uses z axis if nil.
    Worldworld?The world to create the harvestable in. Defaults to the world of the script.

    Returns:

    TypeDescription
    HarvestableThe created harvestable.

    sm.harvestable.getAllHarvestables(world?)

    Returns a table with all the harvestables in the world.

    Parameters:

    TypeNameDescription
    Worldworld?The world, will default to the script's world. (optional)

    Returns:

    TypeDescription
    tableThe table of all harvestables. {Harvestable, ..}

    sm.harvestable.getKinematicByInitialHash(initialHash)

    Gets a kinematic matching the provided initial hash if it exists.

    Parameters:

    TypeNameDescription
    numberinitialHashThe initial hash to search for.

    Returns:

    TypeDescription
    Harvestable The kinematic if it exists.