Skip to content

Mental model

Hold these five rules and the rest of the language clicks.

LeaderstatsServer.server.clppLeaderstatsServer.server.luau (Script).
Hud.client.clpp → LocalScript.
config.clp with no tag → ModuleScript.

You writeYou mean
player.Name / player.Kick()property / instance method
age: int / player:Kick()type / protected (pcall) call
task::wait / players.PlayerAdded::Connectstatic / manual connection
players.PlayerAdded~>ConnectJanitor connection
a .: bstring join

Player player is a Roblox Player. Lifetime is Destroy or Janitor. Access is player.Name, never ->. match arms use the same class name: Part p =>.

4. init starts a script; modules return tables

Section titled “4. init starts a script; modules return tables”

Scripts: define void init().
Modules: usually do not define init() unless the require should run it.

5. CL++ is the language; Cluaupp is the engine cable

Section titled “5. CL++ is the language; Cluaupp is the engine cable”

If a Roblox class is missing from IntelliSense, that is a Cluaupp generated-header problem, not a CL++ syntax problem.

  • local / const / const function
  • Instance.new / game:GetService / require
  • --!strict / --!nonstrict / --!native / --!optimize N from #pragma

Formatting is StyLua’s job. Typechecking emitted Luau is luau-analyze’s job.

Next: Files, tags, includes.