Leave plain-English notes in your code with -- so you and anyone else can understand what a script does.
Luau ignores anything after -- on a line. That sounds useless until you realize it's a notebook glued to your code.
-- This gives the player a coin
local coins = 0
coins = coins + 1
Everything from -- to the end of the line is ignored by Luau — it's for humans. You can also tuck a comment after a line of code:
local coins = 0
coins = coins + 1 -- a coin was picked up
The editor colors comments differently (usually green). If you type -- and your text stays normal-colored, you probably used a different symbol.
Finish the comment so it explains what the next line does: -- the player's total local score = score + 10
The code already says what it does — coins = coins + 1 is obvious. Comments are for the part the code can't tell you: the why.
-- Coins have to be awarded on the server so players can't cheat
local coins = serverCoins + 1
-- Everything below needs the player's character to exist first
task.wait()
local humanoid = character.Humanoid
Good comment, good reason. Bad comment, no reason:
-- This adds one to coins
coins = coins + 1 -- (don't write this)
Comments can also carve sections: a -- === Rewards === line before a block of reward code makes long scripts skimmable.
The one rule that keeps comments useful: when you change the code, change the comment. A comment that says one thing while the code does another is worse than no comment — it actively misleads you.
Write a comment above this line explaining why the wait matters, then the wait call. Add to the starter code.
-- your comment + wait here
print("Character ready")