PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience

5 min

To ask a second question, create a new question and keep adding to the same variable holding the story.

  1. Decide what word to delete from the second sentence in your story.
Original Placeholder
In a tree on a hill, lives the great wizard name1. Every morning, the wizard loves eating a giant bowl of honey roasted food1.
  1. Beneath the first variable, create a new variable to act as a placeholder.
-- Code story between the dashes	
-- =============================================
 
local name1 = storyMaker:GetInput("What is your favorite name?")
local food1 
 
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". "
Reminder: Variable Names

Remember variable names should be lower-cased, and they can’t include spaces in the name.


  1. Use storyMaker:GetInput("") to ask the player a question and store their answer.
-- Code story between the dashes	
-- =============================================
 
local name1 = storyMaker:GetInput("What is your favorite name?")
local food1 = storyMaker:GetInput("What is your favorite food?")
  1. In the story variable, concatenate the next story string using .. Be sure to include a space after the end of the sentence.
-- Code story between the dashes	
-- =============================================
 
local name1 = storyMaker:GetInput("What is your favorite name?")
local food1 = storyMaker:GetInput("What is your favorite food?")
 
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". " .. "Every morning, the wizard loves eating a giant bowl of honey roasted "
  1. After the new story string, concatenate the answer for the second question and finish with punctuation.
-- Code story between the dashes	
-- =============================================
 
local name1 = storyMaker:GetInput("What is your favorite name?")
local food1 = storyMaker:GetInput("What is your favorite food?")
 
local story = "In a tree on a hill lives the great wizard " .. name1 .. ". " .. "Every morning, the wizard loves eating a giant bowl of honey roasted " .. food1 .. ". "

Previous Adding to the Story Next Finishing the Story