sm.unit

Associated object type: Unit

Unit creation and management

Functions:

  • createUnit
  • getAllUnits

  • sm.unit.createUnit(uuid, feetPos, yaw=nil, data=nil, pitch=nil)

    Server only

    Creates a new unit of type from an Uuid

    Parameters:

    TypeNameDescription
    UuiduuidThe character type uuid.
    Vec3feetPosThe feet position in world where unit should spawn.
    numberyaw=nilThe initial yaw. Defaults to 0 (Optional)
    anydata=nilThe param data. (Optional)
    numberpitch=nilThe initial pitch. Defaults to 0 (Optional)

    Returns:

    TypeDescription
    UnitThe created unit.

    sm.unit.getAllUnits()

    Server only

    Returns a table with all the units in the world.

    Returns:

    TypeDescription
    tableThe table of all units. {Unit, ..}