roblox-npc-ai — скилл для Claude Code: NPC и ИИ в Roblox
Помогает писать и чинить NPC в Roblox: поиск пути, машины состояний, обнаружение игроков, спавны и циклы обновления ИИ.
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a claude-codeЧто делает roblox-npc-ai
Скилл подключается, когда вы делаете врагов, ботов или мирных NPC в Roblox. Внутри — рабочие шаблоны на Luau: PathfindingService:CreatePath с настройками AgentRadius, AgentHeight, AgentCanJump и таблицей Costs, где math.huge делает зону непроходимой. Есть разбор машины состояний idle → patrol → chase → attack → flee → dead и порядок проверки цели: сначала расстояние, потом угол обзора, и только в конце рейкаст.
Отдельный блок про сетевую собственность физики. В классических проектах можно вызывать SetNetworkOwner(nil), но это не полная защита. Если проект на Server Authority, настраивать надо модель авторитета, а не считать сетевую собственность границей безопасности. Это повод проверить, как у вас устроен серверный контроль, до того как боты начнут двигаться.
Цикл обновления авторы советуют троттлить и разносить по тикам, опираясь на число NPC, стоимость путей и данные профайлера, а не на единую частоту. Решения и движение остаются на сервере, клиенту достаётся только отрисовка. Для спавнеров, очистки жизненного цикла и бюджетов производительности есть references/full.md. В Studio стоит проверить Workspace.PathfindingUseImprovedSearch на своих картах: из скрипта этот флаг не выставить.
Какие задачи решает
- построить маршрут NPC до цели через
PathfindingService - собрать машину состояний для врага с погоней и атакой
- настроить обнаружение игрока по расстоянию, углу обзора и рейкасту
- разнести обновления ИИ по тикам, чтобы сервер не лагал
- починить NPC, который застревает или проходит сквозь стены
Примеры запросов агенту
- Сделай NPC-патрульного в Roblox: маршрут через PathfindingService и переход в погоню, когда видит игрока
- Мой NPC застревает у двери — добавь PassThrough и PathfindingLink в настройку пути
- Разнеси обновление ИИ по тикам, чтобы сервер не проседал при большом числе врагов
Как установить roblox-npc-ai
1Через Skills CLI (Vercel)
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a claude-code2Вручную: положить файлы
~/.claude/skills/roblox-npc-ai/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/roblox-npc-ai/
1Через Skills CLI (Vercel)
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a codex2Вручную: положить файлы
.agents/skills/roblox-npc-ai/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a cursor2Вручную: положить файлы
.cursor/skills/roblox-npc-ai/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install TabooHarmony/roblox-brain roblox-npc-ai2Вручную: положить файлы
.github/skills/roblox-npc-ai/SKILL.md1Через Skills CLI (Vercel)
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a gemini-cli2Командой платформы
gemini skills install https://github.com/TabooHarmony/roblox-brain --path skills/gameplay/roblox-npc-aiВручную: положить файлы
.devin/skills/roblox-npc-ai/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Из того же набора28
Похожие
Рядом в теме «Геймдев и 3D: Unity, Unreal, Godot, Blender»
Всё по теме «Геймдев и 3D: Unity, Unreal, Godot, Blender» →Вопросы о roblox-npc-ai
Как установить roblox-npc-ai в Claude?
Выполните npx skills add TabooHarmony/roblox-brain --skill roblox-npc-ai -a claude-code. После этого файл скилла лежит в ~/.claude/skills/roblox-npc-ai/SKILL.md.
Что делает roblox-npc-ai?
Даёт агенту готовые приёмы для NPC в Roblox: поиск пути, машины состояний, обнаружение игроков, спавны и циклы обновления ИИ.
Чем этот скилл полезен, если NPC уже ходят, но лагает сервер?
В нём есть раздел про цикл обновления: троттлить и разносить решения ИИ по тикам, опираясь на число NPC, стоимость путей и данные профайлера, а не на единую частоту.
Исходный текст
SKILL.md · MIT
---
name: roblox-npc-ai
description: "Use when creating or fixing Roblox NPCs, bots or enemies: pathfinding, state machines, line of sight, spawns, AI update loops."
when_to_use: "Also when NPCs get stuck, walk through walls, chase wrongly, lag the server, or bots need to fill empty servers."
last_reviewed: 2026-10-14
sources:
- https://raw.githubusercontent.com/Roblox/creator-docs/main/content/en-us/characters/pathfinding.md
- https://create.roblox.com/docs/projects/server-authority
- original
---
# Roblox NPC & AI
## When to Load
Load for NPCs/enemies: pathfinding, state machines, LOS/FOV detection, spawns, AI loops, or physics ownership.
## Quick Reference
### PathfindingService
```luau
local path = PathfindingService:CreatePath({
AgentRadius = 2, AgentHeight = 5, AgentCanJump = true,
Costs = { Water = 20, DangerZone = math.huge },
})
path:ComputeAsync(npcPos, targetPos)
if path.Status ~= Enum.PathStatus.Success then return end
for _, wp in path:GetWaypoints() do
if wp.Action == Enum.PathWaypointAction.Jump then humanoid.Jump = true end
humanoid:MoveTo(wp.Position)
if not humanoid.MoveToFinished:Wait() then return end
end
```
- Recompute on blocked with a bounded retry or cancellation policy.
- In Studio, test `Workspace.PathfindingUseImprovedSearch` on representative maps before rollout; it is not scriptable.
- Avoid long requests and repeated recomputation. Moving collidable geometry can trigger navigation-mesh work.
- Region modifiers: anchored part + `PathfindingModifier` Label → Costs
- `PassThrough = true` for doors; `PathfindingLink` for disconnected navmesh
- `math.huge` cost = non-traversable
### State Machine
`idle → patrol → chase → attack → flee → dead`
- idle/patrol → chase (player detected) → attack (in range) → idle (lost)
- any → flee (health low) → idle (safe); any → dead (health ≤ 0)
- Transitions own movement changes, target cleanup, and cancellation
### Detection (distance → FOV → LOS)
1. **Distance** `(a-b).Magnitude`: cheapest, always first
2. **FOV** `forward:Dot(toTarget)` cosine; use a configured cone for your game, not a universal angle
3. **LOS** `workspace:Raycast`: expensive, last
- If the design includes hearing or proximity detection, make it a separate configured signal rather than a universal FOV bypass.
### Network Ownership
- Classic projects may use `SetNetworkOwner(nil)` for physics-sensitive NPCs, but it is not complete security. In Server Authority projects, configure the authority model instead of treating network ownership as the security boundary.
### Update Loop
- Throttle and stagger AI based on NPC count, path cost, and profiler evidence, not a universal tick rate. Keep NPC decisions and movement server-side; client code may handle presentation.
For spawners, lifecycle cleanup, timeout handling, and performance budgets, load `references/full.md`.
© TabooHarmony · MIT · TabooHarmony/roblox-brain