The first thing to code is the placeholders for the words that the player will fill in. In a script, placeholders for information are called variables. The information they hold can be changed or replaced as needed.
Create the Variable
In Lua code, variables are created by typing
local and the
nameOfTheVariable. All variable names need to be one word with no spaces, like a hashtag, starting with a lowercase letter. A good variable name helps you remember what the variable is for.
Use the placeholder name you wrote down earlier as the name of your variable.
- Under the first dashed line, type
localand then a name for the variable. The placeholder in the example story was
name1, so the first variable is
|In a tree on a hill, lives the great wizard name1.|
|Placeholder in Code|
while playing do storyMaker:Reset()   -- Code story between the dashes -- =============================================   local name1
Previous Opening the Script Next First Challenge