roblox-luau
Installation
SKILL.md
Modern Luau for Roblox
Luau is Roblox's gradually-typed Lua 5.1 derivative. Engine and language move fast; many patterns from older tutorials (and older training data) are deprecated. Apply these defaults to every script you write unless the project clearly uses another convention.
Defaults for all generated code
--!strictat the top of new ModuleScripts (and Scripts when practical). Type public functions.- Get services with
game:GetService("Name")at the top of the file, nevergame.Name. - Use the
tasklibrary:task.wait,task.spawn,task.defer,task.delay,task.cancel. Neverwait,spawn,delay(deprecated, throttled, imprecise). - Yielding engine calls that can fail (DataStore, HTTP, Marketplace, Teleport,
*Async) go insidepcall. - Prefer the
*Asyncvariants of APIs; Roblox renamed most yielding methods (LoadCharacterAsync,GetProductInfoAsync,UserHasBadgeAsync, ...). See the table below. - Disconnect connections / destroy instances you create (see "Cleanup" below).
- Naming:
PascalCasefor services, modules, classes, types, and instance names;camelCasefor locals and functions;SCREAMING_SNAKE_CASEfor constants. - Tabs for indentation (StyLua default in the Roblox ecosystem), double quotes.