Menu
CoddyTech

Build a Platform

Part of the Roblox Game Scripting section of Coddy's Lua journey. Lesson 4 of 24.

Scripts can build the world too. Instance.new makes a new object, and you set its properties before you put it in the game:

local ball = Instance.new("Part")
ball.Name = "Ball"
ball.Shape = Enum.PartType.Ball
ball.Position = Vector3.new(0, 20, 0)
ball.Parent = workspace

A new part is not in the world until its Parent is set to workspace. Setting Parent last means the part shows up already finished.

A new part is also not anchored: gravity pulls it down and it falls. The ball above drops from height 20 onto the ground. A part with Anchored = true stays exactly where you put it, which is what you want for floors, walls and platforms.

challenge icon

Challenge

Easy

This time there is no bridge at all. Your script runs in ServerScriptService and builds one.

Make a new Part that:

  1. is named Platform
  2. has the Size 6, 1, 28 and the Position 0, 10, 0
  3. does not fall
  4. is in the world

Press Play and cross it, then Check.

Try it yourself

local platform = Instance.new("Part")

-- 1. Name it Platform

-- 2. Size and Position

-- 3. Keep it from falling

-- 4. Put it in the world
quiz iconTest yourself

This lesson includes a short quiz. Start the lesson to answer it and track your progress.

All lessons in Roblox Game Scripting

Practice on your own: Online Lua compiler