Menu
Coddy logo textTech

Add a Boolean Flag

Part of the Fundamentals section of Coddy's Lua journey — lesson 38 of 90.

challenge icon

Challenge

Easy

Expand your character profile by adding a boolean status indicator. Declare a new boolean variable called isAwake and set it to true. Display this status information using the print() function and the tostring() function to convert the boolean value to a string for concatenation. Format the output as "Status: true" to maintain consistency with your existing character display.

Try it yourself

-- Character stats from previous lesson
name = "Coddy"
level = 5
hp = 100

-- Display character stats
print("=== Character Status Display ===")
print("Name: " .. name)
print("Level: " .. level)
print("HP: " .. hp)

All lessons in Fundamentals