type

Returns this object’s native object type.

Function

Synopsis

object:type( )

Arguments

None.

Returns

ObjectType or nil type
The corresponding typed constant from mux.world.types, or nil for an unrecognized native type.

Examples

if object:type() == mux.world.types.PLAYER then
  mux.world.pemit(object, "You are a player.")
end

Notes

The returned value cannot be used to change the object’s type. A stale Object raises mux.object.invalid.

See Also