Explosion Course



Designing the Course

Where to put this script?


Put this code in a script under ServerScriptService

local function explodePart(part)
    if part.BrickColor == BrickColor.Red() then
        local explosion = Instance.new("Explosion")
        explosion.Position = part.Position
        explosion.Parent = game.Workspace
        part.BrickColor = BrickColor.White()
    else
        local number = math.random(1,3)
        if number == 1 then
            part.BrickColor = BrickColor.Red()
        end
    end 
end
 
local children = game.Workspace:GetChildren()
while true do
    for _, child in ipairs(children) do
        if child.Name == "ExplosionPart" then
            explodePart(child)
        end
    end
    wait(1)
end