Map rebuilder

Scripts · by Brixborg

Puts a smashed-up map back together every few minutes, with a countdown: whatever is in the Workspace folders Destructible and Loose is copied when the game starts and put back fresh. Goes in ServerScriptService.

Use it in your games: in the studio, open View > Archive, go to the Scripts shelf and pick "Map rebuilder".

The script

-- Copyright (c) 2026 Brixborg Owners. All rights reserved. See LICENSE.txt.
-- REBUILD: puts the map back together. (A Script in ServerScriptService.)
--
-- Everything in the Workspace's "Destructible" folder is loose bricks
-- snapped together; this snaps them when the game starts. Every
-- REBUILD_EVERY seconds (with a countdown at the top of the screen), the
-- broken buildings and the scattered crates are cleared away and fresh ones
-- put in their place. Nothing else rebuilds it: there is no button.

-- ===========================================================================
-- THE NUMBERS
-- ===========================================================================
local REBUILD_EVERY = 200   -- seconds between rebuilds
local WARNING = 10          -- the countdown starts this many seconds before
-- ===========================================================================

local REBUILT = {"Destructible", "Loose"}   -- the folders that are put back
local originals = {}
for _, name in ipairs(REBUILT) do
  originals[name] = workspace:WaitForChild(name):Clone()
end

local function snapTogether(folder)
  for _, item in ipairs(folder:GetChildren()) do
    if item:IsA("Model") then item:MakeJoints() end
  end
end
snapTogether(workspace.Destructible)

local hint = Instance.new("Hint")
hint.Text = ""
hint.Parent = workspace
local lastRebuild = time()

local function rebuild()
  for _, name in ipairs(REBUILT) do
    local old = workspace:FindFirstChild(name)
    if old then old:Destroy() end
    local fresh = originals[name]:Clone()
    fresh.Parent = workspace
    if name == "Destructible" then snapTogether(fresh) end
  end
  lastRebuild = time()
  local message = Instance.new("Message")
  message.Text = "The map has been rebuilt!"
  message.Parent = workspace
  game:GetService("Debris"):AddItem(message, 2.5)
end

while true do
  wait(1)
  local left = REBUILD_EVERY - (time() - lastRebuild)
  if left <= 0 then
    hint.Text = ""
    rebuild()
  elseif left <= WARNING then
    hint.Text = "The map rebuilds in " .. math.ceil(left) .. "..."
  elseif hint.Text ~= "" then
    hint.Text = ""
  end
end

More scripts