Category:Scripting Tutorials

From Goodblox Wiki
Revision as of 17:23, 22 June 2020 by Pizzaboxer (talk | contribs)
Jump to navigationJump to search

Scripting tutorials are tutorials teaching how to do something involving Lua code.


Introduction

This article will explain different ways of adding messages and hints to your place.

How to Insert a Message

While in GoodBlox Studio,

1. In the Explorer panel, select Workspace
2. Go to Insert, then Object...
Template:Studio
Template:Studio
3. In the window that pops up, find Message, and click OK
4. In the Explorer panel, select the message you inserted
5. In the Properties panel, find Text
6. Type the text you want the message to say, and press enter

Your message should appear on the screen.

How to Insert a Hint

While in GoodBlox Studio,

  1. In the Explorer panel, select Workspace
  2. Go to Insert, then Object...
  3. In the window that pops up, find Hint, and click OK
  4. In the Explorer panel, select the hint you inserted
  5. In the Properties panel, find Text
  6. Type the text you want the hint to say, and press enter.

Your message should appear at the bottom of the screen.

Scripting and Messages

You can use Scripting to have more control over your messages.

While in GoodBlox Studio,

  1. In the Explorer panel, select Workspace
  2. Go to Insert, then Object...
  3. In the window that pops up, find Script, and click OK
  4. Find the script in the Explorer panel, and double-click it to open the script editor.
  5. Copy the following and paste it into the script:
local m = Instance.new("Message")	-- inserts a new message
m.Parent = game.Workspace		-- put the message in the workspace
m.Text = "Hello World!" 		-- change "Hello World!" to whatever you like
wait(10)				-- waits 10 seconds
m:Remove() 				-- removes the message

Once you have done that, click the Close Tab File:P01F15.png button to exit the script editor.

To run the script, press the Play Template:Studio button. Be sure to save your place first!

Hints

Here is the same script as above, but for hints:

local h = Instance.new("Hint")
h.Parent = game.Workspace
h.Text = "Hello World!"
wait(10)
h:Remove()

See Also

Pages in category "Scripting Tutorials"

The following 66 pages are in this category, out of 66 total.