I built an AI that writes and runs Luau inside Roblox Studio
Description and use
Cortex is an AI terminal inside Roblox Studio that generates and injects Luau code from plain‑English requests, automatically wrapping changes in change history for undo/redo support.
Problem
Roblox Studio scripting requires boilerplate code and manual editing, slowing development and increasing errors.
Outcome
Cortex automates boilerplate scripting, reduces manual coding effort, and integrates seamlessly with Studio’s undo/redo system, enabling rapid prototyping of common game features.
Workflow
- 1. Install Cortex plugin via github.com/cortex-rbx/roblox-ai-kit
- 2. Open the Cortex terminal inside Roblox Studio
- 3. Type a plain‑English request (e.g., "make a healing potion that gives +25 HP")
- 4. Cortex generates Luau code and applies it to the project (creates Tool, Script, sets properties)
- 5. Verify the result in Studio; use Ctrl+Z to undo if needed
- 6. For editing existing scripts, select the script and give a new request (e.g., "make it respawn the player on death")
- 7. Cortex edits the script’s .Source in place, preserving undo/redo history
Evidence
Cortex AI terminal that lives inside Studio. You type what you want in plain English, it turns that into Luau, and runs it right in your place.
Every change is wrapped in ChangeHistoryService, so Undo/Redo just works.
- Record date: 2026-09-07T14:14:51.864Z