Printing - Roblox Beginners Scripting Tutorial #2 (2024)

BrawlDev
17 Jun 202410:00

Summary

TLDRIn this Roblox beginner scripting tutorial, presenter Balev introduces the concept of scripting as a vital aspect of game development that adds functionality to game creations. He explains what scripts are, how they function in Lua for Roblox, and demonstrates creating and testing a basic script with print statements in the Roblox Studio environment. The tutorial aims to familiarize viewers with the syntax of Lua and encourages them to experiment with print statements, share their creations, and seek help from the community Discord server if needed.

Takeaways

  • 😀 The video is a Roblox beginner scripting tutorial by Balev.
  • 🔍 It covers the basics of navigating Roblox Studio and its features, which are essential for scripting.
  • 🏗️ Scripting adds functionality to games in Roblox, differentiating it from other aspects like building and UI design.
  • 📝 A script is a list of instructions that tell Roblox to execute commands when certain events occur in the game.
  • 🤖 Understanding Lua, the programming language used in Roblox, is crucial for effective scripting.
  • 📁 Scripts can be added to the Workspace or Server Script Service in Roblox Studio.
  • 🔑 The script editor is accessed by clicking on a script object, and it provides a default 'print' command when first opened.
  • 📡 Print statements are used to output messages to the Output window in Roblox Studio, which can be viewed during game testing.
  • 🛠️ The Output window can be accessed through the 'View' tab in Roblox Studio during game testing.
  • ✅ Testing scripts is done by hitting the 'Play' button in the test tab of Roblox Studio, which loads the game with the current scripts.
  • ✍️ Case sensitivity is important in scripting, and syntax must be followed precisely for Roblox to interpret and execute commands.
  • 📝 The tutorial encourages viewers to write their own print statements and share them in the video's comment section for a community challenge.

Q & A

  • What is the main focus of this Roblox beginner scripting tutorial guide?

    -The main focus of this tutorial is to introduce the concept of scripting in Roblox, explaining what scripting is and how it adds functionality to games created on Roblox.

  • What are the other aspects of game development mentioned in the script besides scripting?

    -The other aspects of game development mentioned are building, modeling, and UI designing.

  • What is an example given in the script to illustrate the need for scripting in game development?

    -The example given is a spawn location in a game, which requires scripting to function properly, such as respawning a character after they die.

  • What is a script in the context of Roblox game development?

    -A script in Roblox is a set of instructions or commands written in the Lua programming language that tells Roblox to execute these commands when certain events occur in the game.

  • Why is it important to write scripts in a specific way in Roblox?

    -It is important to write scripts in a specific way to ensure that Roblox can read and interpret the commands correctly, which is crucial for the game's functionality.

  • What is a print statement in scripting and what does it do?

    -A print statement is a command that writes a message to an output window, allowing developers to see the message when they run the game.

  • Where can the output window be found in Roblox Studio?

    -The output window can be found in Roblox Studio by going to the 'View' tab and clicking on the 'Output' button.

  • How can you create a script in Roblox Studio?

    -You can create a script in Roblox Studio by clicking the plus sign next to 'Workspace', searching for 'Script', and selecting the 'Script' option from the list.

  • What is the default command added by Roblox when you open a new script?

    -The default command added by Roblox is 'print("Hello world")', which prints the message 'Hello world' to the output window.

  • How can you test the print statements in your script while playing the game in Roblox Studio?

    -You can test the print statements by clicking the 'Test' tab and then clicking the 'Play' button, which will load your character into the game and display the print messages in the output window.

  • What is the importance of case sensitivity when writing scripts in Roblox?

    -Case sensitivity is important because it affects how the Lua programming language interprets the commands. Being specific with uppercase and lowercase letters ensures that the script functions as intended.

  • What does the tutorial guide encourage viewers to do after completing the learning objective?

    -The tutorial guide encourages viewers to continue the story with more print statements, share their creations in the comment section of the video, and join the Discord server for help if needed.

Outlines

00:00

📝 Introduction to Scripting in Roblox

This paragraph introduces the concept of scripting in Roblox, emphasizing its importance in adding functionality to games. The speaker, Balev, explains scripting as an integral part of game development alongside building, modeling, and UI designing. It highlights the role of scripts as instructions for Roblox to execute, giving an example of a spawn location that requires scripting to function properly. The paragraph also touches on the syntax and rules of Lua, the programming language used in Roblox, and guides viewers through creating their first script in the workspace, including navigating the script editor and understanding the default 'print' command.

05:01

🖋️ Writing Print Statements in Roblox Scripts

In this paragraph, Balev demonstrates how to write and execute print statements in Roblox scripts. Print statements are used to display messages in the output window during gameplay. The speaker instructs viewers on how to delete the default print statement and create custom ones by typing the 'print' command followed by the desired message in quotation marks. The importance of case sensitivity in scripting is also highlighted. Viewers are guided through testing their scripts in Roblox Studio, stopping the game, and continuing to add more print statements to create a sequence of messages. The paragraph concludes with an invitation for viewers to share their print statements in the comments section and an offer of help through a Discord server for those who get stuck during the tutorial.

Mindmap

Keywords

💡Roblox

Roblox is an online platform and game creation system that allows users to design their own games and play a wide variety of different types of games created by other users. In the video, Roblox is the main focus as the tutorial guide is aimed at beginners who want to learn scripting within the Roblox environment.

💡Scripting

Scripting is a critical aspect of game development that involves writing code to add functionality to games. In the context of the video, scripting is introduced as a way to make game elements like spawn locations functional, which is essential for game interactivity.

💡Lua

Lua is a lightweight, high-level programming language designed primarily for embedded use in applications. In the video, Lua is mentioned as the programming language used for scripting in Roblox, highlighting its importance for developers to understand in order to write effective scripts.

💡Spawn Location

A spawn location in gaming is a point where a player's character begins or restarts after death. The script in the video discusses how scripting is used to make a spawn location functional, so that when a character joins or respawns, they appear at this designated spot.

💡Explorer Panel

The Explorer panel in Roblox Studio is a tool that allows users to navigate and manage the objects within their game. In the script, the Explorer panel is mentioned as a place where users can add scripts to their game, which is a key step in the scripting process.

💡Properties Panel

The Properties panel in Roblox Studio provides a detailed view of the properties of selected objects. Although not directly discussed in the script, it is implied that this panel is used throughout the tutorial guide for adjusting object properties in the game.

💡Print Statement

A print statement is a command used in programming to output text to a console or output window. In the video, print statements are demonstrated as a way for beginners to write messages to the output window in Roblox Studio, serving as a basic introduction to scripting commands.

💡Output Window

The output window in Roblox Studio is where developers can view messages, logs, and errors that occur during game testing. The script explains how to access and use the output window to see the results of print statements, which is a fundamental part of testing scripts.

💡Syntax

Syntax refers to the set of rules that defines the structure of statements in a programming language. In the script, the importance of syntax is emphasized for writing commands that Roblox can understand and execute, although detailed syntax explanation is said to be covered in a future episode.

💡Case Sensitivity

Case sensitivity in programming means that the language distinguishes between uppercase and lowercase letters. The script mentions that scripting in Roblox is case sensitive, which is a key concept for beginners to grasp in order to avoid errors when writing scripts.

💡Discord Server

A Discord server is a chat community platform where users can communicate and share information. In the video, the creator invites viewers to join their Discord server for help and support with scripting in Roblox, providing an additional resource for learning and troubleshooting.

Highlights

Introduction to the basics of navigating Roblox Studio and its features.

Explanation of scripting as a game development aspect to add functionality.

The importance of understanding the services offered by Roblox for scripting.

Introduction to the concept of a script as a list of instructions for Roblox.

The necessity of syntax understanding in the Lua programming language for Roblox.

Demonstration of creating the first script in the workspace.

Guidance on using the script editor and reverting to the game view.

Default 'print hello world' command explanation in a new script.

How to find and open the output window to view print statements.

Testing the 'print hello world' statement in the game.

Explanation of print statements for writing messages to the output window.

Case sensitivity in scripting and its importance.

Creating custom print statements and testing them in the game.

Instructions on how to stop play testing in Roblox Studio.

Encouragement to continue creating print statements for practice.

Invitation to share created print statements in the comment section.

Mention of a Discord server for additional help with scripting.

Closing remarks and anticipation for the next episode.

Transcripts

play00:00

welcome back to my Roblox beginner

play00:01

scripting tutorial guide my name is

play00:02

balev and in this episode we'll be

play00:04

discussing about printing so in the last

play00:06

episode we covered the basics of

play00:09

navigating around Roblox studio and what

play00:11

Roblox Studio has to offer for us that's

play00:13

going to be important for this entire

play00:14

tutorial guide so for things like moving

play00:17

around inside of Roblox studio also

play00:19

showing you the services that Roblox has

play00:21

to offer for us the Explorer panel and

play00:23

also the properties panel that we're

play00:25

going to be using throughout this entire

play00:26

tutorial guide now that we have that

play00:28

understanding uh for for the rest of

play00:30

this tutorial guide I'm going to be

play00:32

introducing to you Concepts relating to

play00:35

scripting now to basically explain what

play00:37

scripting is it's an aspect of game

play00:40

development that allows you to add

play00:42

functionality to your games that you're

play00:44

creating on Roblox so the other aspects

play00:47

of game development are things like

play00:49

building like we just did right here um

play00:51

maybe even things like modeling and also

play00:53

um UI designing and all of these other

play00:55

sorts of things scripting is a component

play00:58

of game development that allows you to

play01:00

add functionality to your game an

play01:02

example I can think of this is this

play01:03

spawn location right here so making the

play01:06

spawn location itself requires building

play01:09

but actually making it functional

play01:11

requires scripting so if my character

play01:13

were to join into the game then we need

play01:16

to tell Roblox that we need to spawn on

play01:18

this spawn location and if our character

play01:20

dies then we need to respawn back onto

play01:22

this spawn location so that is what adds

play01:26

functionality to the spawn location

play01:27

rather than it just being some random

play01:29

part inside inside of the game so that

play01:31

requires scripting to be able to um

play01:34

essentially tell Roblox that we want

play01:36

this uh spawn location to function the

play01:39

way it is because of it and we add

play01:41

functionality through scripts now to

play01:44

explain what a script is it's basically

play01:46

a document or a piece of paper that has

play01:49

a list of instructions or commands that

play01:52

basically tells Roblox to execute these

play01:54

commands when we join into the game or

play01:56

when a specific thing happens inside of

play01:58

the game and so when we write these

play02:00

scripts it's very important for us to

play02:02

write it in a very specific way so that

play02:05

Roblox can read these commands and they

play02:07

can interpret it so they can understand

play02:09

it finally execute them inside of our

play02:11

game because this is one of the biggest

play02:13

things new developers get confused with

play02:15

and that is being able to uh get the

play02:17

syntax down like understanding the rules

play02:19

and guidelines when it comes to um

play02:21

writing these commands because they fall

play02:24

under a programming language called Lua

play02:26

or Lua U uh for Roblox and so when we

play02:30

understand this language then we're able

play02:31

to write commands effectively and tell

play02:34

Roblox to execute certain commands

play02:37

within our scripts so let's actually

play02:39

create our first script and we're going

play02:41

to be adding this inside of the Explorer

play02:43

and there's two places that are popular

play02:45

for scripts the first one is the

play02:46

workspace and the second one is the

play02:49

server script service but for this

play02:51

episode we're going to add a script

play02:53

inside of workspace and there's there's

play02:55

a couple ways you can add objects inside

play02:57

of a folder one way is to hit this plus

play03:00

sign that's next to workspace so I'm

play03:01

going to click on this and there should

play03:03

be a list full of all of these um

play03:05

objects that we can put inside of this

play03:07

folder so what I'm going to do is say

play03:10

script inside of the search bar and

play03:12

there's three scripts but for the sake

play03:14

of this tutorial we're just going to be

play03:15

using the normal script so I'm just

play03:17

going to click on this and now we have

play03:20

inserted a script inside of our

play03:23

worksspace and you might have also

play03:24

noticed that our screen has changed to

play03:27

be inside of this script editor and we

play03:31

can revert back to the game if we want

play03:32

to by hitting down this tab right here

play03:34

so we are now back into the normal game

play03:37

and if we want to go back into the

play03:38

script then we just simply click on the

play03:40

script so that we can pull up the script

play03:42

editor again and when we open up the

play03:44

script for the first time Roblox is

play03:45

going to add a default um command here

play03:49

that simply just says print hello world

play03:51

now it might be a little hard to read

play03:53

for you so what I want you to do is hit

play03:55

control and then move the mouse scroll

play03:57

wheel inward so that you can zoom in um

play04:00

but I'm already zoomed in pretty well so

play04:01

if you need to do that then you can do

play04:03

that very quickly so for this first

play04:05

scripting episode what I'm going to show

play04:07

you how to do is write these print

play04:09

statements now what is a print statement

play04:11

a print statement is basically a command

play04:14

that allows us to write a message to an

play04:17

output window so that we can see it uh

play04:20

when we run the game now in order to

play04:22

know where this output window is what we

play04:24

need to do is go back into the game hit

play04:27

on The View Tab and we're going to click

play04:29

on this button that says output so if we

play04:31

click on this then we can see this

play04:33

window down here that shows our um our

play04:37

print statements and also our logs as

play04:39

well that's the whole point of the

play04:40

output window it's so that we can see

play04:42

whatever we put inside of here show up

play04:44

down here when we join into the game so

play04:46

if we go into the game we can actually

play04:49

test this out for ourselves the way we

play04:50

do that is by hitting on this test tab

play04:52

up here and then we click on this button

play04:54

that says play so if we click on this

play04:56

then what's going to happen is first of

play04:58

all I our character actually loads into

play05:00

the game and we can play this game

play05:02

normally as if this was a Roblox game um

play05:05

but also down here we can see in the

play05:07

output it says hello world which was our

play05:10

message and we can actually click on um

play05:13

the script that executed this command

play05:15

and it's going to show us the script and

play05:18

also the line of where our print message

play05:20

executed so this print statement is

play05:23

basically a print command that tells

play05:26

Roblox that we want to print this

play05:28

message down here inside of this output

play05:32

so that we can see it for ourselves and

play05:33

we can write our own print statements as

play05:35

well um rather than having roblox's

play05:38

default print message right over here so

play05:41

what we can do is actually delete this

play05:43

print statement so that we can write our

play05:44

own print statement so what I'm going to

play05:46

do is hold down the backspace so that it

play05:49

basically deletes all the lines of code

play05:50

that um was over here so we are on line

play05:54

number one and now let's add in our

play05:56

first print statement now one quick

play05:59

thing I want want to mention is that

play06:00

when we are writing our scripts it's

play06:03

very case sensitive and what that means

play06:05

is you have to be very specific with how

play06:08

you write stuff inside of the script so

play06:09

some things can be uppercase some things

play06:11

can be lowercase and it's very important

play06:13

that we understand when it is uppercase

play06:16

and when it's lowercase so now let's

play06:17

write our print statement we're simply

play06:19

going to say in all lowercase we're

play06:20

going to say print p in and then what

play06:24

we're going to do is type the open

play06:26

parentheses so we're going to press

play06:28

shift 9 and then we're also going to put

play06:30

in the double quotations so we're going

play06:32

to say shift apostrophe and so now we

play06:35

can write whatever message we want

play06:37

inside of these quotations so we can say

play06:40

as something as simple as hello just

play06:42

like this with an explanation mark and

play06:45

there we go this is our very first print

play06:47

statement that we have going on right

play06:48

over here we can test this by going into

play06:50

the game and hitting play so as we can

play06:53

see in the output it indeed printed our

play06:56

message with hello now I forgot to

play06:58

mention really quickly that uh when

play06:59

we're playing the game inside of Roblox

play07:02

Studio like we hit play uh in order for

play07:04

us to stop play testing uh we go up here

play07:07

and then just simply hit the stop button

play07:08

I forgot to mention this because I do it

play07:10

out of instinct so I apologize about

play07:12

that um so what we're going to do is hit

play07:14

stop and now we are back into Roblox

play07:16

studio so now let's go back to our

play07:18

script and we can actually add more

play07:20

print statements on top of this print

play07:21

statement so what we're going to do is

play07:23

drop a line by hitting enter and as you

play07:26

can see we are now on line number two so

play07:28

we can write our print statement just

play07:30

like uh we did the first time by saying

play07:32

print open parentheses and we're going

play07:35

to say double quotations and we can

play07:37

continue what we were saying before by

play07:39

saying how are you doing question mark

play07:43

just like this so now we have two print

play07:45

saens if we go into the game and hit

play07:48

play then what we should see in the

play07:49

output is two of our print saens instead

play07:52

of just one so it's going to start with

play07:53

hello and then it's going to say how are

play07:55

you doing so if we hit stop and then we

play07:57

go into the script we can continue this

play08:00

chain of print statements if we want to

play08:02

uh we can go and hit enter and then we

play08:04

can write another print statement by

play08:06

saying print open parentheses double

play08:08

quotations and then I can say I'm doing

play08:13

very well exclamation mark so now we

play08:15

have three print statements and you can

play08:17

continue going down the script editor

play08:19

and just keep adding more and more print

play08:21

statements if you want to do that um

play08:23

because you can make this as long as you

play08:24

want to like there's like you have the

play08:26

power to make as many PR statements as

play08:28

you want like if we go back back into

play08:29

the game and hit play then as you can

play08:31

see in the output it's going to display

play08:32

the three print messages that we just

play08:34

created now you don't have to worry

play08:36

about the Syntax for right now that's

play08:37

going to be explained in a future

play08:38

episode but what I want you to do is I

play08:41

literally want you to type exactly what

play08:43

I'm typing here so that you get the feel

play08:45

for knowing how to implement this stuff

play08:47

inside of Roblox studio and so that

play08:48

you're getting the experience alongside

play08:51

me as we go through the scripting

play08:52

episodes so that's basically going to be

play08:54

it for this episode what I want you to

play08:56

do for today's learning objective is to

play08:58

continue this story of like you know

play09:00

these three print statements you can

play09:01

just continue down here by writing

play09:03

another print statement or if you want

play09:05

you can delete all of these print

play09:07

statements and write your own story or

play09:09

whatever it is you want to create so you

play09:11

can just delete the entire thing and

play09:12

then you can start back from square one

play09:13

if you want to it's really up to you

play09:15

with what you want to do now after you

play09:16

do this what I encourage you to do is

play09:18

take your print statements go down to

play09:20

the comment section of this video and

play09:21

then paste it so that other viewers can

play09:23

see um your poem or your message or

play09:26

whatever it is that you're comfortable

play09:27

sharing uh to everybody El because I

play09:29

just think it would be very fun to see

play09:31

what everybody's doing for these

play09:32

challenges so go ahead and do that uh

play09:35

once you finish with this learning

play09:36

objective and one more thing before we

play09:38

end off this video if you get stuck at

play09:40

any point throughout this tutorial guide

play09:42

I have a Discord server which you can go

play09:44

into to ask questions and get help for

play09:46

your scripts if you want through the

play09:48

link in the description so if you're

play09:49

interested then feel free to join my

play09:51

Discord server to get help while you go

play09:52

through this tutorial guide so that's

play09:54

pretty much going to be it for this

play09:55

tutorial guide I hope you enjoyed it and

play09:56

I will see you in the next episode take

play09:59

care what

Rate This

5.0 / 5 (0 votes)

相关标签
RobloxScriptingTutorialGame DevelopmentLuaPrint StatementsBeginner GuideFunctionalitySpawn LocationDiscord Support
您是否需要英文摘要?