Difference between revisions of "Category:Scripting Tutorials"

From Goodblox Wiki
Jump to navigationJump to search
(Replaced content with "Scripting tutorials are tutorials teaching how to do something involving Lua code.")
Tag: Replaced
 
Line 1: Line 1:
 
Scripting tutorials are tutorials teaching how to do something involving Lua code.
 
Scripting tutorials are tutorials teaching how to do something involving Lua code.
{{CatUp|Tutorials}}
 
 
== Introduction ==
 
 
This article will explain different ways of adding [[GBX.lua.Message (Object)|messages]] and [[GBX.lua.Hint (Object)|hints]] to your place.
 
 
== How to Insert a Message ==
 
 
While in [[GoodBlox Studio]],
 
:1. In the [[Explorer]] panel, select [[GBX.lua.Workspace (Service)|Workspace]]
 
:2. Go to '''Insert''', then '''Object...'''
 
::{{Studio|Menu$Insert}}
 
 
::{{Studio|Menu$Insert$Object}}
 
: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 (Property)|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,
 
#In the Explorer panel, select Workspace
 
#Go to Insert, then Object...
 
#In the window that pops up, find '''Hint''', and click OK
 
#In the Explorer panel, select the hint you inserted
 
#In the Properties panel, find Text
 
#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|Scripting]] to have more control over your messages.
 
 
While in GoodBlox Studio,
 
#In the Explorer panel, select Workspace
 
#Go to Insert, then Object...
 
#In the window that pops up, find '''Script''', and click OK
 
#Find the script in the Explorer panel, and double-click it to open the script editor.
 
#Copy the following and paste it into the script:
 
 
<pre>
 
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
 
</pre>
 
 
Once you have done that, click the '''Close Tab''' [[Image:P01F15.png]] button to exit the script editor.
 
 
To run the script, press the '''Play''' {{Studio|Test$Run}} button. '''Be sure to save your place first!'''
 
 
=== Hints ===
 
 
Here is the same script as above, but for hints:
 
 
<pre>
 
local h = Instance.new("Hint")
 
h.Parent = game.Workspace
 
h.Text = "Hello World!"
 
wait(10)
 
h:Remove()
 
</pre>
 
 
== See Also ==
 
 
*[[Hint]]
 
*[[Message]]
 
*[[Nil]]
 
 
[[Category:Scripting Tutorials]]
 

Latest revision as of 18:23, 22 June 2020

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

Pages in category "Scripting Tutorials"

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