后端与数据库

roblox-luau

el4cteo/roblox-skills

Modern, type-safe Luau for Roblox, covering --!strict and the new type solver, generics, string interpolation, if-expressions, task library, require-by-string, module/OOP patterns, error handling with retries, buffer/vector, and legacy APIs to avoid. Use when writing, refactoring, or explaining any Roblox script, fixing type errors, or modernizing old Lua code.

  • 552 次安装
  • 55 星标
  • 收录于

安装命令

npx skills add https://github.com/el4cteo/roblox-skills --skill roblox-luau

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

  1. --!strict at the top of new ModuleScripts (and Scripts when practical). Type public functions.
  2. Get services with game:GetService("Name") at the top of the file, never game.Name.
  3. Use the task library: task.wait, task.spawn, task.defer, task.delay, task.cancel. Never wait, spawn, delay (deprecated, throttled, imprecise).
  4. Yielding engine calls that can fail (DataStore, HTTP, Marketplace, Teleport, *Async) go inside pcall.
  5. Prefer the *Async variants of APIs; Roblox renamed most yielding methods (LoadCharacterAsync, GetProductInfoAsync, UserHasBadgeAsync, ...). See the table below.
  6. Disconnect connections / destroy instances you create (see "Cleanup" below).
  7. Naming: PascalCase for services, modules, classes, types, and instance names; camelCase for locals and functions; SCREAMING_SNAKE_CASE for constants.
  8. Tabs for indentation (StyLua default in the Roblox ecosystem), double quotes.