Skip to content

optional<T>

Type

A value that may be missing. Emits Luau T?.

optional<T> name = null;
NameTypeDescription
TtypeInner type.

T or null.

T?

Not std::optional with .value(). Test with != null or guard.

optional<Player> target = null;

Emits:

local target: Player? = nil

null · guard