sm.unit
Associated object type: Unit
Unit creation and management
Functions:
sm.unit.createUnit(uuid, feetPos, yaw=nil, data=nil, pitch=nil)
Server only
Creates a new unit of type from an Uuid
Parameters:
| Type | Name | Description |
|---|---|---|
| Uuid | uuid | The character type uuid. |
| Vec3 | feetPos | The feet position in world where unit should spawn. |
| number | yaw=nil | The initial yaw. Defaults to 0 (Optional) |
| any | data=nil | The param data. (Optional) |
| number | pitch=nil | The initial pitch. Defaults to 0 (Optional) |
Returns:
| Type | Description |
|---|---|
| Unit | The created unit. |
sm.unit.getAllUnits()
Server only
Returns a table with all the units in the world.
Returns:
| Type | Description |
|---|---|
| table | The table of all units. {Unit, ..} |