Part 1 - Print and Variables

0 0 0
                                    

The first thing you should learn is the Print command. Type in

print()

Print displays a inputted message or variable (we'll get to that later) or whatever you want. So to display a specific message. For example, Type in

print("Hello World!")

Once the command or script is run, the print command will display in the output what you put in the brackets.

Output:

Hello World!

So now instead of 'Hello World!' put wherever else you want to. (Remember to keep the quotation marks).

Now onto variables. Variables (if you don't know) are a storage unit. So for example if I did

ExampleVariable = 123

print(ExampleVariable)

Output:

123

(The reason I didn't put quote marks in the print is because I wasn't typing a string. Strings are text). So the print outputted ExampleVariable, which had a value of 123. You can also set the variables value to a string. For example

ExampleVariable = "One two three"

print(ExampleVariable)

Output:

One two three

Cool right?

Now variables can also hold (on Roblox) objects! If you don't know what an object is it is a part or something in the game of Roblox.

CoolObject = game.Workspace.MyFavPart

print(CoolObject)

Output:

MyFavPart

And that's all I'm showing you today.

Thank you for reading the first part of my Lua coding tutorial! I do not know if I will continue this project but idk...

You've reached the end of published parts.

⏰ Last updated: May 20 ⏰

Add this story to your Library to get notified about new parts!

Lua Coding for Beginners (Roblox's Additions.)Where stories live. Discover now