sm.unit
Associated object type: Unit
Unit creation and management.
Functions
createUnit
sm.unit.createUnit( uuid, feetPos, yaw, data, pitch )
Server-Only
Creates a new unit.
Arguments:uuid
[ Uuid ]: The character type uuid.feetPos
[ Vec3 ]: The feet position of the unit, at the spawn position.yaw
[ number ]: The initial yaw. Defaults to 0.data
[ any ]: Extra parameters for the unit. Optional.pitch
[ number ]: The initial pitch. Defaults to 0.
- [ Unit ]: The created unit.
getAllUnits
sm.unit.getAllUnits()
Server-Only
Returns a table of all units in the world.
Returns:- [ table ]: The table of units.