This tutorial covers essential Roblox Studio scripting concepts including variables (which can store any object type without explicit type declarations), properties (blue cubes), events (purple lightning bolts that trigger connected functions), methods (purple cubes accessed via colon), and the task library for asynchronous operations like task.wait() and task.spawn(). It also explains the critical distinction between local side (runs on user's computer, affects only that player) and server side (runs on Roblox servers, affects all players), along with StarterContainers for organizing scripts in character and player models.
Deep Dive
Prerequisite Knowledge
- No data available.
Where to go next
- No data available.
Deep Dive
Tips and Tricks for New Scripters in Roblox StudioAdded:
Hello, welcome to my intro to Roblox scripting video. And I'm going to get started here with these three variables.
The variable is started with local variable name into whatever you want.
And variables can be literally everything in Roblox Studio. You don't need to like it's not like other languages where you have to write in what the type of uh object it is. You can literally do anything. A part, its position, tables, everything. Now, when you get in a part, let's say let's start with the part variable right here. So to break it down, I have the variable. It's named part and it ref and to find where the part is like without we got get workspace and workspace points to here and then the dot will point to everything under workspace this includes everything here and all the properties inside here and all stored methods and events which I'll get to later. So and once it gets that part is under workspace done and done now part when you put a dot you might notice it gives you a list of a bunch of random things and this might seem really overwhelming but I'll teach you what all of these symbols mean. So the blue the blue cube are the properties of the part. Uh the purple lightning bolt is called an event. Events are every time an event occurs it fires functions that are connected to it. Now uh next thing the three orange lines these are these can these are also usually properties cuz here we have material and the material is also property. The three orange lines means it's not a regular property. It requires an enom and enoms are like custom variable types. So if you type in enom here and put dot, you'll get the enms for every single thing in the in Roblox Studio. And material is an enom.
It requires an enum. So if I want to change the material of a part, the part material, I have to type in enom. Type in material cuz the enum requires a material enom. And then I get access to all the materials that I can use to put inside of this material inside this property. I mean, sorry. It's not like you can put in a string. I mean, some of them some of the some of the stuff you can put in a string. it will like auto translate it. But in scripting language formally, it wants an add-on. That's what the orange lines are. And finally, the last thing is uh where is this? Oh yeah, I just do. If you do a colon, you'll get these purple cubes, the moving purple cubes. And these are methods and these are like built-in functions that do a certain task. So if I the most simple one destroy, it runs a function where it destroys the part. If I do uh what's the one that required? Oh yeah, is is a very simple function. It allows you, this function returns true or false depending on whatever you put in here. And since we already know this is a part, this function, this method is basically useless. But basically, I want to check, if I want to check if this variable is a part. I put in part here and it will return true because it is a part. Those are what methods are. Now, let's talk about events. Events, the first one you'll probably learn is touched. And all events come with the method called connect. And what connect does allows you to connect stuff to functions. And if I create a function here, let's create an add two numbers function. And the two arguments are a and b.
So what this will do is whatever the function equals to, it will return a and b. But obviously uh the return thing doesn't work with connect because there's uh you have to do you have to make a outside variable first to store the number to do it. But okay, let's do add two numbers. If I put in this function in here, no parenthesis. It has to be the function without parenthesis.
And this is basically this allows you to store the function. Just in case you didn't know, if I do funk here, add two numbers, I have a variable that points to a function. That means I can put this in here too instead. And if I want to run the function to the variable, I put in the parenthesis and put in the two numbers in here like this.
Now, what this will do is create a connection. The this yellow thing I'm this yellow triangle represents the event. And whenever an event fires, in this case, whenever something touches the part, we have our function here. And when I run this connect thing, I create a connection right here. And whenever it gets touched, whenever the touch f activates, it will go through all connected functions. Meaning I could connect this twice in a row and it will run twice or three times. I made three connections and make and every time the touch event fires, it runs all it runs all three of these connections. That's why it's important. That's why some games tend to lag this thing called memory leaks. Every time you're done with a function, like, oh, I don't want this function to run anymore or it will never run again. I want to sever the the connection through this other method.
Uh, we need to make a variable to do this, a variable called connection and make it point to one of these. You, like I said, you can make a variable point into literally everything. And this one points to a connection, and the connection has a method called disconnect, which severs the connection.
And you want to do this or else your game will lag. Too many connections will lag your game. So that's the basics of those. And now the next thing is to talk about conditionals. Uh, you can also make conditionals into a you can also do this.
Five is bigger than 10 which will obviously print out false and this will print out false. You can uh yeah like this is just demonstrating that variables can point to literally everything. So if you do that it will create a false and you can make this fancier by I add this function compare compare to numbers and I can return the result of this which is completely useless by the way since we already have this thing that does the same thing. and it will give me the same result.
And this is useful for if the numbers are changing, like you have a mini game where you're comparing people's scores.
Uh, I did not print out the result.
Whoops.
Oh, made it string. Supposed to print out the variable, which should be false.
There we go.
Now, other useful things you should know outside of just coding, cuz those are all the basic things that might confuse people. Oh, yeah. The task keyword. This contains a library of very very useful methods. Uh the most useful one is test weight makes the script weight. It's better than regular weight. I don't know why they still keep this here. I don't know why this isn't just the default.
You type less. But people want you to use test.weight instead. This one's more accurate. Now the very useful method you want to know is test.spawn. And this takes a function as a bread. So usually when you run a function wait then print.
uh if I put a weight statement here and then make it print uh let's say the argument right here and I call this three times first second this will this will make uh me wait 3 seconds and then make me wait another 3 seconds print second what if I wanted to print them all at the same time I wanted to run two functions simultaneously next to each other this is what taskspawn is for and it accepts functions and be careful do not put in the parenthesis and when you do this I can run things simultaneously but obviously how do I put in my arguments if I can't use the parenthesis so the solution to that is to create a function inside here you don't need to put in a variable you can sort of just make a new function inside the parenthesis like I got this fun like if I copy paste this out this is literally just a blank function without a variable name. If I and then I paste it back in, this will not error. This will not error. So, I put this in and then I put in my arguments.
So, I copy and paste this twice. I'm pretty sure there's an easier way to do this. I'm just stuck with doing this as a habit. This will run both scripts at the same time. So, if I rerun this, it will print first and second at nearly the same time. Obviously, first will come first cuz I I sent this one first.
I should probably explain what some of these containers do. Uh, start a character script. Whatever you put in here will end up in any character character that spawns and I put a part inside here. That means when Oops. I need to make my character spawn in. Uh when I spawn in my character, it should have this part under my character model right here. This is part of my character model. And player script is the same thing, but for the player object. Player object is located under players. And this is where the actual like uh this is where the local side player stuff come in. Oh yeah, local side and server side.
Should probably explain the difference.
Basically, local side, there are two.
You can switch between them with this button right here. Uh things that happen local side are run on the user's computer. So if I delete this local side, it should still be there server side. But if I delete this one server side, it should also disappear local side. The reason being is because whatever happens on the server, it will automatically do it for the for all the locals the all users computers. But if you delete something from the user's computer local side, it won't happen on the server side. And that's how you make cut scenes because obviously if you run a cut scene script where you move somebody move a camera, you only want one person to see it. You don't want it to affect everyone. And there's only one camera per local side. Like some somebody might have thought that everyone like all the ser all the cameras that everyone uses are stored server side. It doesn't work like that.
All of them are on the local side. If I delete this camera, I lose access to uh my local camera and I only can see the server camera. Why would I delete the server camera then? Oh, it won't even let me. Oh, yeah. Oh, yeah. That should be all the basics for Roblox Studio.
Other stuff like server script service.
This is for uh just storage. Only the server can see this. By the way, local side cannot see whatever you put in here. Uh replicated storage both server side and local side can see it. And the same principle applies where if where the deletion is only one way from is a one-way relationship where if you delete local side, it won't go to server side.
If you delete a server side, it won't it will it will go to local side. The effects will happen local side. Yeah, that should be the basic rambling. All right, goodbye.
Related Videos
Agentforce NOW AMA: Build with React and Salesforce Multi-Framework
SalesforceDevs
490 viewsβ’2026-05-28
How agent o11y differs from traditional o11y β Phil Hetzel, Braintrust
aiDotEngineer
450 viewsβ’2026-05-28
WEB TECHNOLOGIES UNIT-2 | Degree 4th sem BCOM Computers web technologies unit-2 full explanationπ―β
LearnwithSahera
1K viewsβ’2026-05-29
More tests are always better? How to use AI to identify tests that bring little value
Alliance4Qualification
335 viewsβ’2026-05-29
Search Algorithms Explained in 60 Seconds! π€π¨
samarthtuliofficial
218 viewsβ’2026-06-01
People of Game of Thrones using JavaScript DOM
AltCampus
296 viewsβ’2026-05-30
Introduction to Problem Solving Part - 1 | Lecture 1 | Intermediate DSA
ascensionix
107 viewsβ’2026-05-29
So What's Odin Lang Even Good For
TechOverTea
131 viewsβ’2026-06-01











