Skip to content

Types and values

CL++ is statically typed in the source and in the Luau it emits.

int coins = 100;
float speed = 16.5;
string name = "Kartz";
string title = 'Player';
string line = `hello {name}`;
bool isActive = true;
func callback = func () {};
Player playerRef = null;
Write thisEmit this
int float doublenumber
boolboolean
stringstring
voidno return annotation
func(...any) -> any
autoinferred from new, GetService, datatype ctor
nullnil
optional<T>T?

Always initialize: int coins; emits nil. Prefer int coins = 0;.

Player player is an Instance of class Player. There is no address, no delete, and no ->. Properties and instance methods use .. Protected calls use :. Static names use ::.

match arms use the same class name: Part p =>.

player.Name = "Kartz";
player.FindFirstChild("leaderstats");
part.Size = Vector3(8, 1, 8);
part.CFrame = CFrame.lookAt(from, look);
part.Material = Enum.Material.Plastic;

These are values. Do not write new Vector3.

static_cast<Folder>(existing) emits existing. Luau does not check ClassName at the cast.

const / static constexpr become Luau const.

See the generated Types API. Next: Operators.