if / elseif / else / end: Coding lesson for kids

In this lesson, children learn to write an if/elseif/else block and trace the branch Lua executes.

if score > 10 then: Starts the check — notice "then", not a colon or braces.

elseif score > 5 then: One word, "elseif" — not "else if" like JavaScript.

else: Runs if NONE of the above conditions were true — the fallback.

end: Every if block MUST close with "end" — Lua has no indentation rule and no braces.

This lesson is part of Lua in Coding at Pearls Valley Academy — The language behind Roblox’s Luau.

Each lesson starts with a short narrated, animated explanation, then hands-on practice. A wrong answer gets a gentle hint, never a penalty, and children earn stars and pearls as they go.