v3 · Activity 1 of 9 · tables · arrays · indexing · 3 min Runs here
A table can hold several related values. In this list, entry 1 is Lamp and entry 2 is Door. Square brackets select an entry by its position.
Change the selected entry to display Door.
Door
Lines must stay in order. Spelling, capitalization and spaces inside a message matter.
local colors = {"Orange", "Blue"}
print(colors[1])Reading entry 1 displays Orange.
New syntax: {}, [1]
Curly braces create the table. Commas separate the entries. Luau lists start at position 1; the order in the list determines which value [1] reads.
Select a word or symbol in this authored example. Your editor draft stays unchanged.
tools ,
tools1This is a private experiment copy. It does not replace your answer or complete the activity.
Your output will appear here.
Replace this code with the starter? Download your draft to keep a copy.
Your output will appear here.
Sign in with RoCreators to save private progress across devices. Community verification is separate.