# An AI that playtests what it builds
Code that compiles is not the same as a game that works. Luafox starts playtests in Roblox Studio, reads what the game printed, and can play the game itself with a short test that acts like a player and checks the outcome.

Luafox can playtest a Roblox game for you. After it changes how the game runs, it starts a playtest in Studio and reads the Output, or runs a scripted playtest that walks, touches parts, uses prompts and fires remotes like a real player, then reports every check that passed or failed along with the errors the server and client printed. It fixes what failed and tests again before it tells you it is done.

## Why an AI agent should test its own work
Most AI coding tools stop when the code looks right. In Roblox that leaves the hard part to you: does the coin pad pay out, does the shop refuse a player with no coins, does the checkpoint respawn you in the right place? Luafox treats “verify before you claim” as part of the job. When it has changed scripts, it reads the Output and checks the scripts it touched before it answers, and when a change affects how the game runs, it playtests it. In its final answer it says what it verified and what it did not.

## Quick checks: a playtest and the Output
For a quick look, Luafox starts a normal playtest (Play, or Run for server logic without a player), reads the Output log for errors and warnings, and stops the playtest again. It always stops a playtest before editing again, because edits in Studio do not reach a game that is already running. If you use the connector on the computer with Studio, it can also take screenshots of the Studio window to look at builds, lighting and UI.

## Scripted playtests: Luafox plays your game
A scripted playtest goes further. Luafox writes a short Luau test, Studio starts a fresh playtest with the test running inside it on the server, and the test plays as the player. When it finishes, the playtest ends by itself and Luafox gets a report. The test kit includes:

- **Move:** Walk to a part or position like a player, teleport, jump, or stand on a part so its Touched events fire.

- **Interact:** Hold a ProximityPrompt, and fire RemoteEvents or invoke RemoteFunctions from the player’s client, so your server-side validation is really tested.

- **Read:** Leaderstats, properties and attributes of any instance, the player’s UI (is the shop button on screen, what does it say), and Luau run on the client.

- **Check:** Named checks and expectations (“buying a sword takes 50 coins”), log lines, and waits that poll until something happens instead of sleeping.

A typical request, and what the test does with it:

YouAdd a coin pad that gives 10 coins, with a cooldown, and test it.

- **Arrange.** Read the player’s Coins before the test and teleport next to the pad.
- **Act like a player.** Stand on the pad.
- **Check the outcome.** Coins went up by exactly 10.
- **Check what must not work.** Standing on it again straight away pays nothing, because of the cooldown.
- **Read the report.** Every check passed or failed, plus any error the server or client printed. An error fails the test even when every check passed.

Luafox is told to include at least one thing that should not work in every test, such as buying without enough coins, claiming a reward twice, or sending a forged argument to a remote. Those are the bugs players find first.

Some Studio builds do not let a plugin press GUI buttons. When the test cannot click a button, it says so, and Luafox fires the RemoteEvent the button would fire instead and checks the UI separately.

## What the report shows
The result appears in the chat as a card: how many checks passed, how long the test took, each check with a tick or a cross, what a failed check got instead of what it expected, and the errors from the Output marked as server or client. A failed check is where Luafox starts its next fix, and it runs the same test again afterwards.

YouThe shop test failed on “cannot buy without coins”. Fix it and run the test again.

## Settings and safety

- **Playtest to check work** (Settings, Agent) is on by default. Switch it off and Luafox asks you to playtest instead, and its playtest calls are refused.
- **Ask before risky actions** also covers scripted playtests, because the test is Luau that runs inside the playtest.
- A playtest is a separate copy of the game: nothing the test does is saved to your place.
- The plugin’s switch for running Luau in the Studio widget turns scripted playtests off too.

## Questions about AI playtesting

### Can it test multiplayer?
A scripted playtest plays as one player, which covers most gameplay logic and remote validation. Testing with several real players at once is still something to do yourself, or with Studio’s own multi-client test.

### Does it replace testing with real players?
No. It catches broken logic, missing handlers and errors quickly and repeatably. Whether the game is fun, clear and fair still needs people.

### What does it need?
Roblox Studio with the Luafox plugin, connected to your account. See [the download page](https://luafox.uk/download) to set it up.

### Does a test cost credits?
Writing the test and reading the report are model time, like any other step. Running the playtest itself happens in your Studio.

## Related

- [AI Luau scripting An AI that reads your Roblox game, writes and edits Luau scripts with exact diffs, checks them for errors across scripts, and fixes what breaks.](https://luafox.uk/features/roblox-scripting-ai)
- [Fix script errors with AI A practical way to fix Roblox Studio Output errors with an AI agent: read the exact error and line, test one cause at a time, and prove the fix in a playtest.](https://luafox.uk/guides/fix-roblox-script-errors-with-ai)
- [Make a Roblox game with AI Can AI make a Roblox game? An honest, step-by-step answer: what an AI agent builds well in Studio today, where it still needs you, and how to ship.](https://luafox.uk/guides/make-a-roblox-game-with-ai)
- [Security How Luafox keeps your computer, game and keys safe: outgoing-only connections, device pairing, one-step undo, ask-first mode and what is stored where.](https://luafox.uk/security)
- [Download Get the Luafox plugin for Roblox Studio and the optional connector for Blender, MCP servers and your AI plan, with install steps for Windows, Mac and Linux.](https://luafox.uk/download)
