Skip to content
TheChatArchiveThe Chat Archive
o1-mini-2024-09-12· OpenAIAi2 WildChat-4.8M (AI2)

Make a roblox script i can paste into the command line that builds a "skyscraper" use…

  1. User

    Make a roblox script i can paste into the command line that builds a "skyscraper" use orientation or size to rotate the parts and add as much detail as possible.

  2. Assistant

    Certainly! Below is a comprehensive Roblox Lua script that you can paste directly into Roblox Studio's Command Bar to generate a detailed skyscraper. This script constructs a multi-story building with floors, windows, a roof, an antenna, and additional architectural details to enhance realism.


    Detailed Skyscraper Generation Script

    --[[ 
        Skyscraper Generator Script for Roblox
        Description: Builds a detailed skyscraper with multiple floors, windows, a roof, and an antenna.
        Usage: Paste this script into the Command Bar in Roblox Studio and press Enter.
    --]]
    
    -- Parameters Configuration
    local numberOfFloors = 50          -- Total number of floors in the skyscraper
    local floorHeight = 5             -- Height of each floor (in studs)
    local floorWidth = 100            -- Width of the building
    local floorDepth = 100            -- Depth of the building
    local windowSize = Vector3.new(4, 6, 1)  -- Size of each window
    local windowSpacingX = 10         -- Horizontal spacing between windows
    local windowSpacingZ = 10         -- Depth spacing between windows
    local windowPlateThickness = 0.5  -- Thickness of the window pane
    local skyscraperColor = BrickColor.new("Institutional white") -- Building color
    local windowColor = BrickColor.new("Bright blue")            -- Window color
    local roofColor = BrickColor.new("Black")                    -- Roof color
    local antennaColor = BrickColor.new("Really black")          -- Antenna color
    
    -- Create the main skyscraper model
    local skyscraper = Instance.new("Model")
    skyscraper.Name = "Skyscraper"
    
    -- Create the base foundation
    local base = Instance.new("Part")
    base.Size = Vector3.new(floorWidth + 20, floorHeight, floorDepth + 20)
    base.Position = Vector3.new(0, floorHeight / 2, 0)
    base.Anchored = true
    base.BrickColor = BrickColor.new("Brown") -- Foundation color
    base.Name = "Foundation"
    base.Parent = skyscraper
    
    -- Create Floors and Windows
    for i = 1, numberOfFloors do
        -- Create Floor Separator
        local floorSeparator = Instance.new("Part")
        floorSeparator.Size = Vector3.new(floorWidth, 0.5, floorDepth)
        floorSeparator.Position = Vector3.new(0, i * floorHeight, 0)
        floorSeparator.Anchored = true
        floorSeparator.BrickColor = skyscraperColor
        floorSeparator.Name = "Floor_" .. i
        floorSeparator.Parent = skyscraper
    
        -- Create Windows on the Current Floor
        local floorY = i * floorHeight + 0.25 -- Slightly above the floor separator
    
        -- Calculate number of windows per side
        local numWindowsX = math.floor((floorWidth - 20) / windowSpacingX)
        local numWindowsZ = math.floor((floorDepth - 20) / windowSpacingZ)
    
        -- Create a grid of windows
        for x = 1, numWindowsX do
            for z = 1, numWindowsZ do
                -- Create Window Pane
                local window = Instance.new("Part")
                window.Size = windowSize
                window.CFrame = CFrame.new(
                    (-floorWidth / 2 + 10) + x * windowSpacingX,
                    floorY,
                    (-floorDepth / 2 + 10) + z * windowSpacingZ
                )
                window.Anchored = true
                window.CanCollide = false
                window.BrickColor = windowColor
                window.Material = Enum.Material.Glass
                window.Transparency = 0.3
                window.Name = "Window_" .. i .. "_" .. x .. "_" .. z
                window.Parent = skyscraper
            end
        end
    end
    
    -- Add a Roof
    local roof = Instance.new("Part")
    roof.Size = Vector3.new(floorWidth + 20, floorHeight, floorDepth + 20)
    roof.Position = Vector3.new(0, (numberOfFloors + 1) * floorHeight - floorHeight / 2, 0)
    roof.Anchored = true
    roof.BrickColor = roofColor
    roof.Name = "Roof"
    roof.Material = Enum.Material.SmoothPlastic
    roof.Parent = skyscraper
    
    -- Add an Antenna
    local antenna = Instance.new("Part")
    antenna.Size = Vector3.new(2, 30, 2)
    antenna.Position = Vector3.new(0, (numberOfFloors + 1) * floorHeight + 15, 0)
    antenna.Anchored = true
    antenna.BrickColor = antennaColor
    antenna.Name = "Antenna"
    antenna.Material = Enum.Material.Neon
    antenna.Parent = skyscraper
    
    -- Add Lighting Details (Emission for Lights)
    for _, window in ipairs(skyscraper:GetChildren()) do
        if window.Name:match("^Window_") then
            local light = Instance.new("SurfaceLight")
            light.Color = Color3.fromRGB(255, 255, 200) -- Warm light
            light.Face = Enum.NormalId.Front
            light.Range = 15
            light.Brightness = 2
            light.Parent = window
        end
    end
    
    -- Optional: Rotate the Skyscraper for Orientation
    -- Example: Rotate 45 degrees around the Y-axis
    -- local rotationAngle = math.rad(45)
    -- skyscraper:SetPrimaryPartCFrame(CFrame.new(skyscraper.PrimaryPart.Position) * CFrame.Angles(0, rotationAngle, 0))
    
    -- Parent the skyscraper to the Workspace
    skyscraper.Parent = workspace
    

    Script Breakdown

    1. Parameters Configuration:

      • numberOfFloors: Total floors in the skyscraper.
      • floorHeight, floorWidth, floorDepth: Define the dimensions of each floor.
      • windowSize, windowSpacingX, windowSpacingZ: Define window dimensions and spacing.
      • Colors: Set colors for different parts of the skyscraper.
    2. Skyscraper Model:

      • A new Model named "Skyscraper" is created to group all parts together for easier manipulation.
    3. Base Foundation:

      • A large brown part serves as the foundation/base of the skyscraper.
    4. Floors and Windows:

      • For each floor, a horizontal separator (floorSeparator) is created.
      • A grid of windows is placed on each floor with specified spacing.
      • Windows use the Glass material and have partial transparency to mimic real windows.
      • Each window also has a SurfaceLight to simulate interior lighting.
    5. Roof:

      • A solid-colored part serves as the roof.
    6. Antenna:

      • A tall, thin part with a Neon material represents an antenna on top of the roof.
    7. Lighting Details:

      • SurfaceLight instances are added to each window to illuminate them, creating a realistic night-time effect.
    8. Orientation Adjustment (Optional):

      • The commented section allows you to rotate the entire skyscraper for different orientations.
    9. Parenting:

      • Finally, the entire skyscraper model is parented to the workspace so it appears in the game world.

    How to Use the Script

    1. Open Roblox Studio:

      • Launch Roblox Studio and either create a new place or open an existing one.
    2. Access the Command Bar:

      • If it's not visible, enable it by navigating to the View tab and checking the Command Bar option.
    3. Paste the Script:

      • Copy the entire script provided above.
      • Click on the Command Bar at the top and paste the script.
    4. Execute the Script:

      • Press Enter to run the script.
      • A detailed skyscraper will appear at the origin point (0,0,0) of the workspace.
    5. Customize as Needed:

      • Feel free to modify the parameters at the top of the script (like numberOfFloors, floorWidth, windowColor, etc.) to tailor the skyscraper to your preferences.

    Additional Customizations

    • Rotation:

      • To rotate the skyscraper, uncomment and adjust the rotation section in the script. For example, replace 45 degrees with any angle you prefer.
    • Materials and Colors:

      • Experiment with different Material properties (like Metal, Concrete) to change the appearance.
      • Change BrickColor values to your desired colors to match your game's theme.
    • Details:

      • Add more architectural elements like balconies, signage, or decorative fins by inserting additional parts and positioning them accordingly.
    • Scaling:

      • Adjust floorWidth, floorDepth, and floorHeight to create taller or wider buildings.

    Performance Tips

    • Optimizing Parts:

      • A high number of parts (especially windows with lights) can impact game performance. Consider using MeshParts or combining parts when possible.
    • Level of Detail (LOD):

      • Implement LOD systems to reduce the number of active parts when the player is far from the skyscraper.
    • Anchoring:

      • Ensure all parts are anchored to prevent physics calculations that can degrade performance.

    Feel free to experiment and enhance the script further to create even more intricate and unique skyscraper designs!

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.