Game tutorials

Choose a project below. Build it in a fresh place so you can test each step without changing another game.

Build an obstacle course

Build a short jumping course with a platform that gives way underfoot and returns for the next player.

Lay out three jumps

Start with a new place. Keep the SpawnLocation on a wide landing. Insert three Parts and a wide finish platform. Start with platforms about 6 studs wide and leave 2 studs of open space between their edges. Put the last platform a stud higher to change the final jump. Anchor all four and keep CanCollide on.

Give the finish a distinct shape, such as an arch made of three anchored bricks. Leave open ground several studs below the course and give players a way back to the start if they miss. Walk the route once before adding a script. If a jump feels tight, shorten just that gap and try again.

Make the middle platform crumble

Name the middle Part Crumble. Select it in Explorer, insert a Script under it and replace the script contents with the example. The short warning gives a player time to jump. The busy flag keeps a second foot touching the same platform from starting another countdown.

local platform = script.Parent
local busy = false

platform.Touched:connect(function(hit)
    if busy or not game.Players:GetPlayerFromCharacter(hit.Parent) then return end
    busy = true
    platform.Transparency = 0.45
    wait(0.6)
    platform.CanCollide = false
    platform.Transparency = 1
    wait(2)
    platform.Transparency = 0
    platform.CanCollide = true
    busy = false
end)

Play it from both sides

Stand on Crumble. It should fade, drop you and return about two seconds later. On the next attempt, jump during the warning and land on the far side. Try approaching the course while another player is on the platform. Both should see the same opening. To make the route easier, extend the warning before changing the distances.

Back to topics

Build an escape room

Wire two floor switches to one locked exit. Either player can help solve the room, in either order.

Build a room with a readable exit

Make an anchored floor and walls, leaving a doorway at least 6 studs wide. Fit an anchored, solid Part into the doorway. Put the spawn inside the room and a small courtyard outside so players can tell when they have escaped.

  1. Create a Model in Workspace named Lock. Put the door and two anchored floor switches directly inside it. Name the three Parts Door, LeftSwitch and RightSwitch.
  2. Bring each switch slightly above the floor. Place one in view of the door and the other around a corner. Give them the same bright BrickColor so players can recognize the pair.
  3. Insert one ordinary Script directly under Lock, beside the three Parts. Paste the code below. A pressed switch becomes translucent, so the next player can see which one is already active.
local lock = script.Parent
local pressed = {}
local count = 0

local function wire(pad)
    pad.Touched:connect(function(hit)
        if pressed[pad.Name] or not game.Players:GetPlayerFromCharacter(hit.Parent) then return end
        pressed[pad.Name] = true
        pad.Transparency = 0.55
        count = count + 1
        if count == 2 then
            lock.Door.Transparency = 0.8
            lock.Door.CanCollide = false
        end
    end)
end

wire(lock.LeftSwitch)
wire(lock.RightSwitch)

Check the puzzle rules

Walk into the door before touching either switch. It should block you. Step on the left switch twice, then try the door again. It should still be solid. Step on the right switch and walk through. Start a fresh playtest and solve it in the reverse order. In a two-player session, have each player press a different switch. The open door is shared for that session.

Back to topics

Build a checkpoint race

Give each runner an independent clock and require a checkpoint before the finish counts.

Mark a route

Build a track with a turn so runners can see where they are going. Put the spawn beside the start line. Create a Model in Workspace named Race. Inside it, place three anchored, solid strips named StartLine, Checkpoint and FinishLine. Run each strip across the whole track and raise its top a little above the road so feet touch it.

Add a Part named FinishLamp to the same Model. Color it bright green, anchor it above the finish and set Transparency to 1. Add a Script directly under Race. This version lights the finish for spectators and prints individual times to Studio Output.

local race = script.Parent
local runs = {}

race.StartLine.Touched:connect(function(hit)
    local p = game.Players:GetPlayerFromCharacter(hit.Parent)
    if p and not runs[p.Name] then
        runs[p.Name] = {start = tick(), checked = false}
    end
end)

race.Checkpoint.Touched:connect(function(hit)
    local p = game.Players:GetPlayerFromCharacter(hit.Parent)
    if p and runs[p.Name] then runs[p.Name].checked = true end
end)

race.FinishLine.Touched:connect(function(hit)
    local p = game.Players:GetPlayerFromCharacter(hit.Parent)
    local run = p and runs[p.Name]
    if not run or not run.checked then return end
    runs[p.Name] = nil
    local seconds = math.floor((tick() - run.start) * 10) / 10
    print(p.Name .. " finished in " .. seconds .. " seconds")
    race.FinishLamp.Transparency = 0
end)

game.Players.PlayerRemoving:connect(function(p)
    runs[p.Name] = nil
end)

Try a shortcut, then a full lap

Open Output and start a playtest. Cross the start and finish while avoiding the checkpoint. The lamp should stay dark and no result should appear. Cross the checkpoint, then the finish. Look for your name and a time in Output. Repeating the finish alone should produce no new result. Cross the start again to time a second lap. The lamp stays lit after the first valid finish.

With two runners, start the second runner several seconds later and have both cross the checkpoint. Each result should use that runner’s own start time. Times here last for the current session only. To tune the course, compare a first attempt with a clean lap before making the corners tighter.

Back to topics

Build a bowling alley

Use a real rolling ball, free-standing pins and a reset pad to build a repeatable physics game.

Arrange the lane

Build a flat, anchored lane about 12 studs wide and 36 studs long, running along the Z axis. Put the starting end at the larger Z coordinate. Add low side rails and a backstop. In Properties, set the lane’s TopSurface and the pins’ BottomSurface to Smooth so the pins can topple freely. Keep CanCollide on for the lane, ball and pins.

  1. Make a Model named Alley. Inside it, add a Part named Ball. Set its Shape to Ball, make all three size components 3 studs, anchor it and place it just above the starting end.
  2. Add a Model named Pins directly under Alley. Fill it with six upright Parts about 1 stud wide and 3 studs tall. Arrange them in rows of one, two and three, a little apart. Keep them unanchored and clear of any joints. Put the first pin about 18 studs down the lane from the ball.
  3. Put two anchored Parts beside the lane, directly under Alley. Name them Roll and Reset. Give the pads different colors. Add one Script beside them and use this code.
local alley = script.Parent
local ball = alley.Ball
local ballStart = ball.CFrame
local pinStarts = {}
local rolled = false

for _, pin in ipairs(alley.Pins:GetChildren()) do
    pinStarts[pin] = pin.CFrame
end

alley.Roll.Touched:connect(function(hit)
    if rolled or not game.Players:GetPlayerFromCharacter(hit.Parent) then return end
    rolled = true
    ball.Anchored = false
    ball.Velocity = Vector3.new(0, 0, -32)
end)

local function restore(part, pose, stayAnchored)
    part.Anchored = true
    part.CFrame = pose
    part.Anchored = stayAnchored
    part.Velocity = Vector3.new(0, 0, 0)
    part.RotVelocity = Vector3.new(0, 0, 0)
end

alley.Reset.Touched:connect(function(hit)
    if not rolled or not game.Players:GetPlayerFromCharacter(hit.Parent) then return end
    restore(ball, ballStart, true)
    for pin, pose in pairs(pinStarts) do restore(pin, pose, false) end
    rolled = false
end)

Bowl two rounds

Step on Roll and watch from the side. The ball should travel toward decreasing Z and knock at least the first pin out of position. If it runs toward the starting wall, reverse the last component of the launch velocity. If it reaches the rack but pins stay upright, check Anchored, smooth surfaces and joints on the pins.

Once everyone has stepped off Roll, step on Reset. The ball should return to the start and the pins should stand back up. Step off Reset before rolling again, since another foot touching either pad can trigger it. Move the first pin slightly left for a different break. For a two-player match, take turns and count pins before stepping on Reset. Both pads and the rack are shared.

Back to topics