Copy the exact first useful error
Roblox Output can show warnings, prints and several errors after one real failure. The first useful red error after pressing Play is usually the most important one. Copy the full message, script path and line number. Do not summarize it as “it says nil” or “it does not work.” The exact wording tells you whether the problem is a missing object, wrong service path, bad argument, infinite yield, permission issue or runtime state that is not ready.
After copying the line number, inspect the line above it as well. Luau often reports the line where a value is used, not the earlier line where that value became nil. If the error says attempt to index nil, print the variable before that line. If the error says an object is not a valid member, check the Explorer path and spelling. If the error says infinite yield, the script may be waiting for an object that never appears where the code expects it.
Output error:
script path:
line number:
what you clicked:
expected result:
actual result:Use prints as temporary probes
Good debugging adds small temporary prints before the failing line. Print whether the object exists, what value was received and whether a function was called. Remove or tidy those prints after the fix. Do not fill the project with noisy debug output forever. A few focused prints can tell you whether the code path runs at all or whether the bug happens earlier than expected.
When using AI, paste the error plus the surrounding code. A single line is rarely enough. Include the function that contains the line, any variables created above it and the object path. Stellar AI can then explain the likely cause instead of guessing from a tiny snippet.
Separate edit-time from Play-mode bugs
Some scripts only fail in Play mode because player objects, character models, runtime clones or replicated values do not exist while editing. Others fail only in the live flow because the object is created later. Test the same path the player uses. If the feature requires a character, wait for the character. If it requires a GUI, check whether the GUI is cloned into the player. If it requires a tool, confirm the tool is in the player's backpack or character when the code runs.
Fix one error at a time
After one error is fixed, a second error may appear. That does not mean the fix failed. It may mean the first bug was blocking the next step. Work through Output in order. Avoid rewriting a whole system because three errors appear. Start with the first, retest, then handle the next. This makes your final script easier to trust and easier to explain.
Ask Stellar AI for a small patch and a test checklist. A useful answer should name the likely cause, show the exact changed block and tell you how to reproduce the original failure. If the answer does not mention your actual line number or error text, ask it to re-check the evidence.
Turn Output into a patch
Paste the full Output error, script path and nearby code into Stellar AI. Ask for a diagnosis first, then the smallest safe fix.
Open Stellar AI free →