How to fix Roblox script errors (and let AI do it)
When a script breaks, Roblox prints an error in the Output window. The message looks scary, but most errors fall into a few common types.
The most common errors
Attempt to index nil with "X"
You tried to read something from a variable that holds nothing. Usually an object was not found, for example workspace.Door does not exist yet or is named differently. Check the name, or wait for it with WaitForChild.
"X" is not a valid member of Workspace
You asked for a child that is not there. The spelling or capitalization is different, or it has not loaded yet, or it is in another folder. Use FindFirstChild when it might be missing and check for nil.
Infinite yield possible on ...
A WaitForChild is waiting for something that never appears. Look at the path in the message: one part of it is wrong or never gets created.
Attempt to call a nil value
You called a function that does not exist, often because of a typo, a method used on the wrong object, or a ModuleScript that did not return the function.
Players or services returning nothing in a LocalScript
Some things only exist on the server (or only on the client). A script in the wrong place cannot see them. Check if it should be a Script or a LocalScript.
A quick way to debug by hand
- Read the error line and the script name.
- Click the message to jump to the line.
- Check every variable on that line: could any be nil?
- Add a
printbefore it to see the values.
How Kavon fixes errors
Because Kavon is connected to your open game, you do not have to copy the error. It can run the game, read the Output log, find the script behind the error, and patch the exact lines. Then it runs the game again to check that the error is gone.
Ask it something like: "Run the game and fix every error in the Output."
It also searches all scripts for names, so if a RemoteEvent was renamed in one place but not another, it finds both. If it ever changes something you did not want, Ctrl+Z restores it.