Skip to content

to_bool

Builtin · conversion

Coerce a value to true or false.

bool to_bool(value);
NameTypeDescription
valueanyValue to coerce.

bool

not not (value)

null, false, and 0 are falsey in Luau; everything else is truthy. Prefer a real bool when you can.

Instance child = folder.FindFirstChild("x");
bool exists = to_bool(child);

Emits:

local child: Instance = folder:FindFirstChild("x")
local exists: boolean = not not (child)

to_string · to_number · bool · null