In this easy roblox scripting tutorial for absolute beginners, we’ll learn how to script new objects.
So, you’ve been thinking of getting into Roblox scripting, but it’s been difficult for you to take the first step.
Let’s take that first step together.
Here’s an easy Roblox Scripting tutorial for beginners.
Before we get started with this article, make sure that you have Roblox Studio downloaded.
If you’re confused about how to download Roblox Studio, check out this article.
At this point, you should be on the Baseplate of Roblox Studio.

What is Roblox Scripting?
Roblox scripting is when you write code that Roblox understands to make your game work.
Let’s say you wanted to create a game where you arrest criminals, and you wanted the system to work where you can press E and it’ll arrest a nearby criminal.
This entire system would be scripted by a Roblox scripter.
Easy Scripting Tutorial For Beginners
Now, let’s get started with our first script in this easy Roblox scripting tutorial for beginners.
Start by clicking the “View” button on top of Roblox Studio and clicking on the “Explorer” and “Properties” buttons on the top left.

This will enable you to see the two windows on the right side. Make sure that they’re selected.
What is the Explorer Window in Roblox Studio?

The Explorer window shows you all of the objects in your game.
If you click on the little arrow to the left of Workspace, you can see all of the objects in our 3D world.

The SpawnLocation is the object where the players in your game will spawn at when they first enter your game.
We need to get rid of it because it will cause some issues when we write our first script.
Look for the SpawnLocation on your Explorer window, click it, and press delete to get rid of it.
And your SpawnLocation will be gone.

Now, you might be worried that your character won’t spawn without a SpawnLocation. Don’t worry! Roblox will automatically spawn the character in the center of the world.
Moving on, the Baseplate is the big gray checkered object. You can think of the Baseplate like a really large gray lego block.
Now, let’s add our first script into Roblox Studio.
In the Explorer, look for the ServerScriptService section and click on the little “plus” sign next to it. ServerScriptService is essentially where you’re going to put all of your scripts.

Then, search for the word “Script” and click on the white script.

You will immediately see a text editor with the words print("Hello, world!")

A Roblox Scripting Keyword to Create New Objects
You can delete it, and replace it with:
Instance.new("Part", workspace)

This line of code basically tells Roblox “Add a new Part into workspace”
The Instance.new
means “I want to add something new”
The "Part"
means “I want to add a Part”
The workspace
means “I want it to be added into the Workspace section of Roblox Studio.
Now, all the way on the top left of Roblox Studio, you will see a blue play button.

Click it to begin testing your game.
Roblox will now simulate your game, and beneath you is….

The Part that the script created!
We told Roblox to create a Part and place it inside of workspace.
And that’s exactly what it did!
Once you’re done admiring your work of art, click on the red stop button to stop testing your game.

Scripting a WedgePart
Now, go back into your Script and change the word “Part” to the word “WedgePart.”

And click on that happy blue play button.
Suddenly, your character is now on a different type of Part.

Next Easy Scripting Tutorial For Beginners
If you’ve made it this far, that’s awesome! It’s time to take your next steps into Roblox scripting and learn about more awesome things, like….
- Glowing parts and creating neon blocks, so that you can create your own police sirens

- Scripting bricks that kill you, with fire

- Creating large bricks, with cool materials

- And much more!

If you’re ready to learn more about Roblox scripting, check out the Beginner’s Guide to Roblox Scripting, a book that will teach you the basics of scripting, so that you can create really awesome stuff, as described above.
You can get a free sneak-peek by clicking me.
Or view more scripting articles by clicking me.
Happy scripting!