Skip to content

Source:unit

since 1.1.0

Return the source unit (and modify it on Vars and Sensors)

local unit = source:unit([unit])

Parameters

Name Type Required Description
unit integer optional

Returns

unit (integer)

Examples

From the official Ethos documentation
source1 = system.getSource("ALT")
print(source:unit()))
source:unit(UNIT_FOOT)
print(source:unit()))