Match a symptom to its usual cause — nil indexing, string arithmetic, wrong-side changes — and fix in one line.
Some errors repeat so often they have names. Learn their smell and the fix is usually one line.
| Symptom | Usually means |
|---|---|
attempt to index nil | object not found / doesn't exist yet → WaitForChild or check the name |
attempt to perform arithmetic on a string | forgot tonumber on player input |
| Event fires but nothing changes | you changed the wrong object, or the change is client-side |
| Works in Studio, broken live | latency / timing / data stores → add prints, watch live |
Match your error to the smell, apply the reading order from the last lesson, and the fix is usually one line.
You get 'attempt to index nil' on the line character.Humanoid.WalkSpeed. What's the usual cause?
thing.Name where thing is nil is the most common beginner error. The cause is almost always one of three:
workspace.Coinz when the part is Coin.WaitForChild.The error names the exact line. Go read that line, name the nil thing, and pick the cause from the list.
If player.leaderstats.Coins is nil because the folder hasn't been created yet, the fix is to create it in .
The fastest bugs are the ones you typed without noticing: a missing local, a single = where you meant ==, a string where you meant a number. Luau is forgiving about layout, but strict about the words.
Local=coins "0"
Type the fixed line.
attempt to perform arithmetic on a string means a number landed where a string sat — usually player input straight from a TextBox. Fix: tonumber().
"Event fires but nothing changes" is trickier — the code ran, but on the wrong object or the wrong side. A server print shows the server's value; a client print shows the client's. When they disagree, you changed the wrong copy.
Works-in-Studio-broken-live is the advanced smell: data stores (needs the checkbox or a published game), latency (test live), or timing (characters loading). Add prints and watch live.
A player typed '10' into a TextBox. Before adding it to coins, convert it. Write the conversion line.
local typed = "10"
-- convert before math
Next: the map of everything you've learned — and what comes after.