
roblox-npc-ai
Use when creating or fixing Roblox NPCs, bots or enemies: pathfinding, state machines, line of sight, spawns, AI update loops.
- Installs
- 2K
- Last 24h
- +52
- Trending rank
- #3288
- Security
- Not audited
Install
Works with every agent the skills CLI supports.
npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-npc-ai- 01
Install
Run the command in your project. The CLI asks which agents to install for.
- 02
Describe the task
Ask your agent for something this skill covers. It loads roblox-npc-ai automatically when relevant.
- 03
Review the result
The agent follows the SKILL.md steps, scripts and references bundled with the skill.
SKILL.md
The instructions your agent reads when the skill is triggered.
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
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.PathfindingUseImprovedSearchon 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 +
PathfindingModifierLabel → Costs PassThrough = truefor doors;PathfindingLinkfor disconnected navmeshmath.hugecost = 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)
- Distance
(a-b).Magnitude: cheapest, always first - FOV
forward:Dot(toTarget)cosine; use a configured cone for your game, not a universal angle - 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.
FAQ
What does the roblox-npc-ai skill do?
Use when creating or fixing Roblox NPCs, bots or enemies: pathfinding, state machines, line of sight, spawns, AI update loops.
How do I install roblox-npc-ai?
Run npx skills add https://github.com/tabooharmony/roblox-brain --skill roblox-npc-ai in your project. The skills CLI detects the agents you use and copies the skill into the right folder. For Claude Code you can also place the skill folder at ~/.claude/skills/roblox-npc-ai/ (personal) or .claude/skills/roblox-npc-ai/ (project).
Which AI agents can use roblox-npc-ai?
Any agent that supports the open Agent Skills format (a folder with a SKILL.md file), including Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Windsurf, Cline, OpenCode and more.
Is roblox-npc-ai safe to install?
No partner security audit is available yet. Skills can run commands and scripts, so read the SKILL.md and any bundled files before installing.
Who maintains roblox-npc-ai?
It is published by tabooharmony in tabooharmony/roblox-brain. It has 2,027 recorded installs.
More from tabooharmony/roblox-brain
roblox-building
tabooharmony/roblox-brain
Use when building or editing geometry, maps, props, or generated assets with MCP or standalone Luau.
roblox-animation-vfx
tabooharmony/roblox-brain
Use when adding, changing, or fixing Roblox animations, particles, beams, trails, tweens, camera shake, or other visual effects.
roblox-studio-mcp
tabooharmony/roblox-brain
Use when working in Roblox Studio through MCP: editing scripts or scenes, generating assets, playtesting, screenshots, or input.
roblox-lighting
tabooharmony/roblox-brain
Use when setting up or changing Roblox lighting, atmosphere, day/night cycles, or post-processing effects.
roblox-gui
tabooharmony/roblox-brain
Use when building or fixing Roblox menus, HUDs, shops, dialogs, or UI that must work on phones, tablets, desktop and console.
roblox-luau-patterns
tabooharmony/roblox-brain
Use when writing or refactoring Roblox Luau modules, object lifecycles, signals, task scheduling, pcall, and cleanup.
Popular other skills
hyperframes-cli
heygen-com/hyperframes
The HyperFrames CLI by job - scaffold, check, look at frames, edit the timeline, preview, render locally or in the cloud, publish, project history - plus reading its JSON and recovering from build or render failures.
triage
mattpocock/skills
Move issues and external PRs through a state machine of triage roles, categorise, verify, grill if needed, and write agent-ready briefs.
ask-matt
mattpocock/skills
Ask which skill or flow fits your situation. A router over the skills in this repo.
to-questionnaire
mattpocock/skills
Turn a decision you can't fully answer into a questionnaire for someone else to fill in.
loop-me
mattpocock/skills
Grill me about specs for the workflows I want to build, within this workspace.