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.
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
Certainly! Below is a script for Roblox that you can paste into the command line. This script will create a simple skyscraper using parts, rotating them and adding some detail. The skyscraper will be built using multiple floors with windows and a roof.
Make sure to run this in an appropriate environment (like Roblox Studio) where you have permission to create parts.
lua
-- Clear the workspace
workspace:ClearAllChildren()
-- Function to create a part
local function createPart(size, position, color, anchored, rotate)
local part = Instance.new("Part")
part.Size = size
part.Position = position
part.Color = color
part.Anchored = anchored
part.Material = Enum.Material.SmoothPlastic
if rotate then
part.Orientation = rotate
end
part.Parent = workspace
return part
end
-- Create the skyscraper base
local baseSize = Vector3.new(20, 1, 20)
local basePosition = Vector3.new(0, 0, 0)
local baseColor = Color3.fromRGB(100, 100, 100) -- Gray
createPart(baseSize, basePosition, baseColor, true)
-- Create floors
local numFloors = 10
local floorHeight = 3
local floorColor = Color3.fromRGB(150, 150, 150)
for i = 1, numFloors do
local floorSize = Vector3.new(20, floorHeight, 20)
local floorPosition = Vector3.new(0, (i-1) * floorHeight + 0.5, 0)
createPart(floorSize, floorPosition, floorColor, true)
-- Create windows on each floor
local windowSize = Vector3.new(1.5, 1.5, 0.1)
local windowColor = Color3.fromRGB(0, 0, 255) -- Blue for windows
for j = -7, 7, 4 do
for k = -7, 7, 4 do
if (j ~= 0 or k ~= 0) then
createPart(windowSize, floorPosition + Vector3.new(j, 0, k), windowColor, true)
end
end
end
end
-- Create the roof
local roofSize = Vector3.new(22, 1, 22)
local roofPosition = Vector3.new(0, numFloors * floorHeight + 0.5, 0)
local roofColor = Color3.fromRGB(50, 50, 50) -- Darker Gray
createPart(roofSize, roofPosition, roofColor, true)
-- Add some details to the roof
local antennaSize = Vector3.new(0.2, 4, 0.2)
local antennaPosition = roofPosition + Vector3.new(0, 3.5, 0)
local antennaColor = Color3.fromRGB(255, 0, 0) -- Red for antenna
createPart(antennaSize, antennaPosition, antennaColor, true, Vector3.new(0, 0, 0))
print("Skyscraper built successfully!")
Explanation of the Script:
createPart function: This utility function simplifies the creation of parts, allowing you to set the size, position, color, whether it's anchored, and optionally its orientation.
Base: A base is created at the bottom of the skyscraper, serving as the foundation.
Floors: A loop creates multiple floors, each floor consisting of a grey part and several blue "windows" spaced evenly on each side.
Roof: A slightly larger part is created at the top to resemble a roof, followed by a red antenna for some visual interest.
Instructions:
Open Roblox Studio.
Ensure you're in the Command Line or a Script Editor.
Copy the provided script and paste it.
Press Enter to run the script.
You should see a skyscraper with detailed attributes in the workspace! Feel free to modify parameters such as colors, sizes, or the number of floors to customize it further.