Skip to content

Your First Script

Let’s make Hello world script, create a script in ServerScriptService. You will see:

print("Hello, world!")

Then playtest the game, you will see “Hello, world!” in the output. Now, let’s spawn a part in Workspace. First we need to get Workspace using the game’s service functions

local workspace = game:GetService("Workspace")

Now we have workspace. Next, we need to create a part

local part = Instance.new("Part")

We need to put it in Workspace

part.Parent = workspace

We made a part! Let’s change position, size, name, and color of it!

part.Name = "MyPart"
part.Size = Vector3.new(2, 2, 2)
part.Position = Vector3.new(0, 10, 0)
part.Color = Color3.fromRGB(192, 32, 12)
part.Anchored = false

Playtest your game and you will see a part named “MyPart” with a size of 2, 2, 2, a red color, and not anchored.