Start Coding

*Ta zawartość będzie dostępna wkrótce w wybranym przez ciebie języku.

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.

Finding the StoryManager

  1. In the Explorer window, click the arrow next to StarterGUI to see everything beneath it.

  2. Click the arrow next to GameGUI to expand that section.

  3. Double-click the StoryManager script to open it.

Script Contents

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.

For now, notice how a large portion of the script starts with the -- symbol. Lines of code starting with -- are called comments. These are used to leave notes for coders and don't change the way a program runs.


-- 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