一键导入
roblox-luau-core
Use for Luau syntax, tables, control flow, string patterns, math, scope, closures, idioms, or porting code from JavaScript or Python.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Use for Luau syntax, tables, control flow, string patterns, math, scope, closures, idioms, or porting code from JavaScript or Python.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Use when implementing Roblox character animations, particles, beams, trails, tweens, camera shake, or other visual effects.
Use when building Roblox menus, HUDs, shops, notifications, dialogs, or responsive cross-platform UI.
Use when handling Roblox keyboard, mouse, gamepad, touch, motion input, or cross-platform action binding.
Use when validating RemoteEvent or RemoteFunction arguments, adding rate limits, designing server-authoritative systems, or preventing exploits.
Use when creating Roblox NPCs or enemies with pathfinding, state machines, line-of-sight or FOV detection, spawns, or AI update loops.
Use when building Roblox vehicles, ragdolls, projectiles, elevators, constraints, forces, or other physics-driven gameplay.
| name | roblox-luau-core |
| description | Use for Luau syntax, tables, control flow, string patterns, math, scope, closures, idioms, or porting code from JavaScript or Python. |
| last_reviewed | "2026-05-27T00:00:00.000Z" |
| sources | ["https://luau-lang.org/","https://create.roblox.com/docs/luau"] |
Load for Luau syntax questions: variables, operators, tables, string patterns, math helpers, scope/closures, common idioms, porting from JS/Python, and sharp edges (1-based indexing, nil semantics, truthiness). For type annotations, use roblox-luau-types. For OOP/async/modules, use roblox-luau-patterns.
Hand off to: roblox-luau-types (type annotations/generics), roblox-luau-patterns (OOP/async/modules), roblox-* domain skills (engine APIs).
Full reference: references/full.md
Basics: Luau = Lua 5.1 + extensions. Always local. No hoisting — callees above callers. Forward-declare for mutual recursion.
Extensions over Lua 5.1: continue, += -= *=, // floor division, math.clamp/sign/round, backtick interpolation, generalized iteration, table.freeze/clone/clear.
Truthiness: Only nil and false are falsy. 0, "", {} are truthy. No type coercion in == (0 == "0" → false).
Arrays: 1-based. #tbl length — unreliable with nil gaps, keep contiguous. Use table.insert/remove/find/sort/concat. Iterate: for k, v in tbl do.
Strings: Prefer backticks `{name} age {age}` over ... Patterns (NOT regex): %a %d %w %s classes, * + - ? quantifiers, ^$ anchors. Functions: string.match/gmatch/gsub/split.
Tables: Only compound type. Reference semantics (= aliases). table.clone is shallow. nil removes keys. Dynamic keys need bracket notation t[key].
Ternary: (cond and val or fallback) breaks if val is falsy. Use if cond then a else b for safety.
Error handling: pcall(fn) / xpcall(fn, handler). No try/catch.
Pitfalls:
a and b or c fails when b is nil/false: defines implicit self, . doesn't===, !=, spread, const/letreturn, continue, etc.)task.wait/spawn/delay, never deprecated wait/spawn/delayJS→Luau: map/filter → manual loops, null → nil, x ?? y → x or y, x?.y → x and x.y, === → ==, !== → ~=, import → require, class → metatable+__index, try/catch → pcall.
For detailed examples, see references/full.md.