roblox-api
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseroblox-api
roblox-api
When to Use
使用场景
Use this skill when the task is mainly about identifying or confirming the correct Roblox engine surface:
- Finding which class or service owns a capability.
- Checking whether a member is a property, method, event, or callback.
- Confirming datatype constructors, properties, methods, constants, or math behavior.
- Choosing the correct enum family and item for a property or parameter.
- Looking up globals such as ,
game,workspace,script, orplugin.Enum - Confirming built-in library behavior such as ,
task,math,string,table, oros.vector - Verifying exact parameter shapes, return values, and deprecation status before writing code.
Do not use this skill when the task is mainly about:
- Overall Roblox project structure, code placement, or client-server responsibility.
- Remote security, replication architecture, persistence design, or Open Cloud workflows.
- Broader system design where API lookup is secondary to structural decisions.
当任务主要是识别或确认正确的Roblox引擎接口时使用本技能:
- 查找哪个类或服务具备某项能力。
- 检查某个成员属于属性、方法、事件还是回调。
- 确认数据类型构造函数、属性、方法、常量或数学运算行为。
- 为属性或参数选择正确的枚举族和枚举项。
- 查询、
game、workspace、script、plugin等全局变量。Enum - 确认、
task、math、string、table、os等内置库的行为。vector - 编写代码前验证具体的参数结构、返回值和废弃状态。
当任务主要涉及以下内容时不要使用本技能:
- 整体Roblox项目结构、代码放置位置或客户端-服务器职责划分。
- 远程调用安全、复制架构、持久化设计或Open Cloud工作流。
- API查询仅为次要需求的广义系统设计。
Decision Rules
决策规则
- Use this skill if the main question is "what engine API should I call or read here?"
- Use this skill when a known problem needs the correct class, member, datatype, enum, global, or library surface.
- Start with the narrowest surface that matches the question:
- Class or service for engine objects and services.
- Datatype for value objects such as ,
Vector3,CFrame, orRaycastParams.TweenInfo - Enum for preset values such as .
Enum.RaycastFilterType.Exclude - Global for always-available names like ,
game,workspace, orscript.Enum - Library for free functions under tables like ,
task,math, ortable.string
- If the task is really about where code belongs, which side owns state, or how systems should be arranged, hand off to .
roblox-core - If the task centers on remotes, trust boundaries, replication correctness, or server authority, hand off to .
roblox-networking - If the task centers on persistent storage, quotas, save design, or cross-server state, hand off to .
roblox-data - If the task centers on Open Cloud, OAuth, or external integrations, hand off to or
roblox-cloud.roblox-oauth - If a request mixes referential lookup with out-of-scope design, answer only the engine-reference portion and explicitly exclude the rest.
- 如果核心问题是「我应该在这里调用或读取哪个引擎API?」,使用本技能。
- 当已知问题需要匹配正确的类、成员、数据类型、枚举、全局变量或库接口时,使用本技能。
- 从最匹配问题的最小范围接口开始查询:
- 引擎对象和服务查询类或服务。
- 、
Vector3、CFrame、RaycastParams等值对象查询数据类型。TweenInfo - 等预设值查询枚举。
Enum.RaycastFilterType.Exclude - 、
game、workspace、script等始终可用的名称查询全局变量。Enum - 、
task、math、table等表下的自由函数查询库。string
- 如果任务实际关注代码归属、状态所属端或系统架构方式,转交给处理。
roblox-core - 如果任务核心是远程调用、信任边界、复制正确性或服务端权限,转交给处理。
roblox-networking - 如果任务核心是持久化存储、配额、存档设计或跨服务器状态,转交给处理。
roblox-data - 如果任务核心是Open Cloud、OAuth或外部集成,转交给或
roblox-cloud处理。roblox-oauth - 如果请求混合了参考查询和超出范围的设计需求,仅回答引擎参考相关部分,并明确排除其余内容。
Instructions
使用说明
- Identify the missing fact before searching:
- Which engine object or service is responsible?
- Which member kind is needed?
- Which datatype or enum is expected by the API?
- Which global or library helper fits the job?
- Choose the correct reference file first:
- for surface selection.
references/engine-overview.md - for class, service, and member lookup.
references/classes-reference.md - for value types and their usage.
references/datatypes-reference.md - for enum families and items.
references/enums-reference.md - for Luau and Roblox globals.
references/globals-reference.md - for built-in libraries.
references/engine-library-yaml-files.md - for interpreting datatype YAML shape and overloads.
references/datatype-yaml-files.md
- Confirm the exact API contract before coding:
- Member name.
- Member kind.
- Parameter order and types.
- Return type.
- Property type.
- Enum family and item names.
- Deprecation or other tags.
- Prefer the documented modern surface when an older global or legacy form also exists:
- Prefer over
task.wait().wait() - Prefer over
task.delay().delay() - Prefer for service access when clarity matters.
game:GetService()
- Prefer
- When a datatype or library page shows overloads, read all overloads before choosing a call pattern.
- When a parameter or property type points to another datatype or enum, follow that dependency and confirm it separately.
- Keep the answer referential and implementation-facing:
- Name the correct surface.
- State the relevant signature or property type.
- Mention any important enum values, tags, or constraints.
- Do not drift into architecture, persistence, or security-system design.
- 查询前先确认需要补充的信息:
- 哪个引擎对象或服务负责对应能力?
- 需要哪种类型的成员?
- API需要哪种数据类型或枚举?
- 哪个全局变量或库工具适配需求?
- 优先选择正确的参考文件:
- 接口选型参考。
references/engine-overview.md - 类、服务和成员查询参考。
references/classes-reference.md - 值类型及其用法参考。
references/datatypes-reference.md - 枚举族和枚举项参考。
references/enums-reference.md - Luau和Roblox全局变量参考。
references/globals-reference.md - 内置库参考。
references/engine-library-yaml-files.md - 数据类型YAML结构和重载解析参考。
references/datatype-yaml-files.md
- 接口选型参考
- 编码前确认准确的API契约:
- 成员名称。
- 成员类型。
- 参数顺序和类型。
- 返回类型。
- 属性类型。
- 枚举族和枚举项名称。
- 废弃标记或其他标签。
- 当存在旧的全局变量或遗留形式时,优先使用官方文档记录的现代接口:
- 优先使用而非
task.wait()。wait() - 优先使用而非
task.delay()。delay() - 需要明确性时优先使用获取服务。
game:GetService()
- 优先使用
- 当数据类型或库页面存在重载时,阅读所有重载后再选择调用模式。
- 当参数或属性类型指向其他数据类型或枚举时,跟进该依赖并单独确认。
- 保持回答的参考性和面向实现的属性:
- 给出正确的接口名称。
- 说明相关签名或属性类型。
- 提及任何重要的枚举值、标签或约束。
- 不要偏离到架构、持久化或安全系统设计范畴。
Using References
参考文档使用指引
- Open first when the user only knows the problem and not the engine surface.
references/engine-overview.md - Open when the question is about classes, services, or member discovery.
references/classes-reference.md - Open when a value object or helper container is involved.
references/datatypes-reference.md - Open when an API expects a preset constant.
references/enums-reference.md - Open when the question involves built-in names available in scripts.
references/globals-reference.md - Open when the needed API lives under
references/engine-library-yaml-files.md,task,math,string,table,os,utf8,coroutine,debug,buffer, orbit32.vector - Open when constructor overloads, mutable-vs-immutable behavior, constants, or member lists need careful interpretation.
references/datatype-yaml-files.md
- 当用户仅知道问题但不清楚对应引擎接口时,优先打开。
references/engine-overview.md - 当问题涉及类、服务或成员查找时,打开。
references/classes-reference.md - 当涉及值对象或辅助容器时,打开。
references/datatypes-reference.md - 当API需要预设常量时,打开。
references/enums-reference.md - 当问题涉及脚本中可用的内置名称时,打开。
references/globals-reference.md - 当所需API属于、
task、math、string、table、os、utf8、coroutine、debug、buffer或bit32下时,打开vector。references/engine-library-yaml-files.md - 当需要仔细解读构造函数重载、可变性与不可变性行为、常量或成员列表时,打开。
references/datatype-yaml-files.md
Checklist
检查清单
- The missing fact is identified as class, member, datatype, enum, global, or library lookup.
- The chosen engine surface is the narrowest one that matches the problem.
- Member kind, parameter order, return type, and property type are confirmed before use.
- Required enum family and item names are spelled exactly.
- Datatype constructors or methods match the documented overload.
- Deprecated globals or legacy forms are not recommended unless necessary for compatibility.
- The response stays referential and does not drift into project architecture, persistence, or cloud workflows.
- Out-of-scope systems are handed off to the proper Roblox skill when needed.
- 已确认需要补充的信息属于类、成员、数据类型、枚举、全局变量或库查询范畴。
- 选择的引擎接口是最匹配问题的最小范围接口。
- 使用前已确认成员类型、参数顺序、返回类型和属性类型。
- 所需的枚举族和枚举项名称拼写完全正确。
- 数据类型构造函数或方法与文档记录的重载匹配。
- 除非兼容性需要,否则不推荐已废弃的全局变量或遗留形式。
- 响应保持参考属性,不会偏离到项目架构、持久化或云工作流范畴。
- 超出范围的系统需求会在需要时转交给对应的Roblox技能处理。
Common Mistakes
常见错误
- Using for project structure questions that belong to
roblox-api.roblox-core - Guessing a member name without confirming whether it is a property, method, event, or callback.
- Passing raw numbers where an enum item is expected.
- Treating a datatype like an Instance class, or vice versa.
- Missing constructor overloads and choosing the wrong parameter order.
- Recommending deprecated globals like or
wait()whendelay()equivalents are the modern surface.task - Assuming a global exists in every context, especially .
plugin - Expanding a simple API lookup into networking, data, or cloud-system design.
- 将属于的项目结构问题使用
roblox-core处理。roblox-api - 未确认成员属于属性、方法、事件还是回调就猜测成员名称。
- 在需要枚举项的位置传入原始数字。
- 将数据类型当作Instance类处理,反之亦然。
- 忽略构造函数重载选择了错误的参数顺序。
- 推荐或
wait()等已废弃的全局变量,而不使用delay()模块下的现代等价接口。task - 假设全局变量在所有上下文都存在,尤其是。
plugin - 将简单的API查询扩展到网络、数据或云系统设计范畴。
Examples
示例
Choose the right surface for a raycast
为射线检测选择正确的接口
- Class or service: (via
Workspacebehavior)WorldRoot - Method:
Workspace:Raycast(origin, direction, raycastParams) - Datatype:
RaycastParams - Enum:
Enum.RaycastFilterType - Result datatype:
RaycastResult
- 类或服务:(继承
Workspace行为)WorldRoot - 方法:
Workspace:Raycast(origin, direction, raycastParams) - 数据类型:
RaycastParams - 枚举:
Enum.RaycastFilterType - 结果数据类型:
RaycastResult
Confirm a tween API call
确认补间API调用
- Class or service:
TweenService - Method:
TweenService:Create(instance, tweenInfo, propertyTable) - Datatype:
TweenInfo - Enums often involved: ,
Enum.EasingStyleEnum.EasingDirection
- 类或服务:
TweenService - 方法:
TweenService:Create(instance, tweenInfo, propertyTable) - 数据类型:
TweenInfo - 常用关联枚举:、
Enum.EasingStyleEnum.EasingDirection
Distinguish global, datatype, and enum usage
区分全局变量、数据类型和枚举用法
lua
local Workspace = game:GetService("Workspace")
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
local cf = CFrame.lookAt(Vector3.new(0, 5, 10), Vector3.zero)- is a Roblox global.
game - ,
RaycastParams, andCFrameare datatypes.Vector3 - is an enum item.
Enum.RaycastFilterType.Exclude
lua
local Workspace = game:GetService("Workspace")
local params = RaycastParams.new()
params.FilterType = Enum.RaycastFilterType.Exclude
local cf = CFrame.lookAt(Vector3.new(0, 5, 10), Vector3.zero)- 是Roblox全局变量。
game - 、
RaycastParams和CFrame是数据类型。Vector3 - 是枚举项。
Enum.RaycastFilterType.Exclude