One Stage
Lesson 2 of 21 in Coddy's Roblox Game: Endless Tower course.
The tower is built from stages: Models waiting in ServerStorage.Stages, where players never see them. Each is 16 studs tall. It starts on a white Start pad in the middle and ends on an Exit ledge at its top.
To use one, copy it with Clone and parent the copy to something in the workspace. The template stays in ServerStorage, ready to copy again:
local copy = stages.Bounce:Clone()
copy.Parent = workspaceThe stages of a tower go together in one Model, so a whole tower can later be cleared in one go.
Challenge
EasyPut the first stage of your tower in the world.
- Near the top:
local ServerStorage = game:GetService("ServerStorage"),local stages = ServerStorage.Stagesandlocal tower = nil. - Write
buildTower(): settowerto a new Model namedTowerin the workspace, then clonestages.Stepsand parent the copy totower. - Call
buildTower()at the end.
Press Play: blue steps stand in the middle, ready to climb. Then Check.
Try it yourself
local Players = game:GetService("Players")
local Settings = require(game.ReplicatedStorage.Settings)
print("Each tower has " .. Settings.StageCount .. " stages")
-- Every player gets Wins on the leaderboard
Players.PlayerAdded:Connect(function(player)
local leaderstats = Instance.new("Folder")
leaderstats.Name = "leaderstats"
leaderstats.Parent = player
local wins = Instance.new("IntValue")
wins.Name = "Wins"
wins.Parent = leaderstats
end)
-- Lesson 2: One Stage goes here
All lessons in Roblox Game: Endless Tower
Practice on your own: Roblox playground