BranchLuau✎

if / else. Any value can be the condition — only nil and false take the False branch, so an Instance? can be tested directly. A Branch on another Branch's False pin compiles to elseif, so a chain of conditions stays at one level of indentation and ends with one end. Bind, in the Inspector, writes if local admin = admins[id] then and hands admin to the True side as a pin of its own, for a value that may be nil. if local is a Studio beta: turn on If Local/Const Bindings in Studio's Beta Features.

Pending review

BranchTrueConditionFalse
  • part of the language itself, so it works in Roblox and in Lune

Inputs

  • in:execution
  • Condition:any= true

Outputs

  • True:execution
  • False:execution

What it compiles to

Script StartƒxLuau ExpressionisAliveBranchTrueConditionFalsePrintStill go…ValuePrintGoneValue
The graph this output was compiled from.
luau
if isAlive then
	print("Still going")
else
	print("Gone")
end

Not reviewed yet