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

2 min

In Roblox, code is typed inside of scripts using the coding language Lua. Games often have separate scripts for each thing the game needs to do. The library template already has a script named StoryManager which you’ll add more code to for your word game.

To find the StoryManager script:

  1. In the Explorer window, click the arrow next to StarterGUI to see everything beneath it.
  1. Click the arrow next to GameGUI to expand that section.
  1. Double-click the StoryManager script to open it.

The StoryManager Script

The script already contains some of the code that’s necessary for showing the completed story to the player. All of the code you create will be typed below the dashed lines.

--Special acknowledgement @polarpanda16.
  
-- GLOBAL VARIABLES
local storyMaker = require(script:WaitForChild("StoryMaker"))
  
-- Code controlling the game
local playing = true
  
while playing do
	storyMaker:Reset()
  	
	-- Code story between the dashes	
	-- =============================================
  	
  	 
  	
  	
  	
  	
  	
  	
  	
	-- =============================================
  		
	-- Add the story variable between the parenthesis below 
	storyMaker:Write()
  
	-- Play again?
	playing = storyMaker:PlayAgain()
end
Comments

Lines of code starting with -- are comments. Comments are used to leave notes for yourself and other coders. They don’t change the way the program runs.



Previous Opening the Template Next Coding Variables