local Players = game:GetService("Players")
local player = Players.LocalPlayer
local playerGui = player:WaitForChild("PlayerGui")

-- Create ScreenGui
local screenGui = Instance.new("ScreenGui")
screenGui.Name = "VSCodeUI"
screenGui.Parent = playerGui
screenGui.ResetOnSpawn = false

-- Main draggable window frame
local window = Instance.new("Frame")
window.Size = UDim2.new(0, 900, 0, 600)
window.Position = UDim2.new(0.5, -450, 0.5, -300)
window.BackgroundColor3 = Color3.fromRGB(30, 30, 30)
window.BorderSizePixel = 0
window.Active = true
window.Draggable = true
window.Parent = screenGui

-- Title bar
local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 40)
titleBar.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
titleBar.BorderSizePixel = 0
titleBar.Parent = window

local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -110, 1, 0)
titleLabel.Position = UDim2.new(0, 10, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "Roblox VSCode"
titleLabel.Font = Enum.Font.SourceSansBold
titleLabel.TextSize = 22
titleLabel.TextColor3 = Color3.fromRGB(220, 220, 220)
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.Parent = titleBar

-- Close button
local closeButton = Instance.new("TextButton")
closeButton.Size = UDim2.new(0, 80, 1, 0)
closeButton.Position = UDim2.new(1, -80, 0, 0)
closeButton.BackgroundColor3 = Color3.fromRGB(180, 50, 50)
closeButton.Text = "Close"
closeButton.Font = Enum.Font.SourceSansBold
closeButton.TextSize = 18
closeButton.TextColor3 = Color3.fromRGB(255, 255, 255)
closeButton.Parent = titleBar

closeButton.MouseButton1Click:Connect(function()
    screenGui:Destroy()
end)

-- Save button (copies code to clipboard)
local saveButton = Instance.new("TextButton")
saveButton.Size = UDim2.new(0, 80, 1, 0)
saveButton.Position = UDim2.new(1, -170, 0, 0)
saveButton.BackgroundColor3 = Color3.fromRGB(80, 150, 80)
saveButton.Text = "Save"
saveButton.Font = Enum.Font.SourceSansBold
saveButton.TextSize = 18
saveButton.TextColor3 = Color3.fromRGB(255, 255, 255)
saveButton.Parent = titleBar

-- Sidebar (file explorer)
local sidebar = Instance.new("Frame")
sidebar.Size = UDim2.new(0, 220, 1, -40)
sidebar.Position = UDim2.new(0, 0, 0, 40)
sidebar.BackgroundColor3 = Color3.fromRGB(40, 40, 40)
sidebar.BorderSizePixel = 0
sidebar.Parent = window

local sidebarTitle = Instance.new("TextLabel")
sidebarTitle.Size = UDim2.new(1, 0, 0, 40)
sidebarTitle.BackgroundTransparency = 1
sidebarTitle.Text = "Explorer"
sidebarTitle.Font = Enum.Font.SourceSansBold
sidebarTitle.TextSize = 22
sidebarTitle.TextColor3 = Color3.fromRGB(200, 200, 200)
sidebarTitle.Parent = sidebar

local fileList = Instance.new("ScrollingFrame")
fileList.Size = UDim2.new(1, 0, 1, -40)
fileList.Position = UDim2.new(0, 0, 0, 40)
fileList.BackgroundTransparency = 1
fileList.BorderSizePixel = 0
fileList.CanvasSize = UDim2.new(0, 0, 0, 0)
fileList.ScrollBarThickness = 6
fileList.Parent = sidebar

local UIListLayout = Instance.new("UIListLayout")
UIListLayout.Parent = fileList
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder

local exampleFiles = {"main.lua", "utils.lua", "config.lua"}

for i, fileName in ipairs(exampleFiles) do
    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(1, 0, 0, 30)
    btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
    btn.BorderSizePixel = 0
    btn.Text = fileName
    btn.Font = Enum.Font.SourceSans
    btn.TextSize = 16
    btn.TextColor3 = Color3.fromRGB(220, 220, 220)
    btn.Parent = fileList

    btn.MouseEnter:Connect(function()
        btn.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
    end)
    btn.MouseLeave:Connect(function()
        btn.BackgroundColor3 = Color3.fromRGB(50, 50, 50)
    end)
end

-- Tab bar
local tabBar = Instance.new("Frame")
tabBar.Size = UDim2.new(1, -220, 0, 40)
tabBar.Position = UDim2.new(0, 220, 0, 40)
tabBar.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
tabBar.BorderSizePixel = 0
tabBar.Parent = window

local tabs = {"main.lua", "utils.lua"}
local selectedTab = nil

local function selectTab(tabButton)
    if selectedTab then
        selectedTab.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
    end
    selectedTab = tabButton
    selectedTab.BackgroundColor3 = Color3.fromRGB(70, 70, 70)
end

for i, tabName in ipairs(tabs) do
    local tabBtn = Instance.new("TextButton")
    tabBtn.Size = UDim2.new(0, 140, 1, 0)
    tabBtn.Position = UDim2.new(0, (i-1)*140, 0, 0)
    tabBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 45)
    tabBtn.BorderSizePixel = 0
    tabBtn.Text = tabName
    tabBtn.Font = Enum.Font.SourceSans
    tabBtn.TextSize = 16
    tabBtn.TextColor3 = Color3.fromRGB(220, 220, 220)
    tabBtn.Parent = tabBar

    tabBtn.MouseButton1Click:Connect(function()
        selectTab(tabBtn)
        editor.Text = "-- You opened " .. tabName .. "\nprint('Hello from " .. tabName .. "')"
        highlightText(editor.Text)
    end)

    if i == 1 then
        selectTab(tabBtn)
    end
end

-- Editor container (to stack highlighted label and textbox)
local editorContainer = Instance.new("Frame")
editorContainer.Size = UDim2.new(1, -220, 1, -80)
editorContainer.Position = UDim2.new(0, 220, 0, 80)
editorContainer.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
editorContainer.BorderSizePixel = 0
editorContainer.Parent = window

-- Highlighted text label (syntax colored, multiline, non-editable)
local highlightedLabel = Instance.new("TextLabel")
highlightedLabel.Size = UDim2.new(1, -10, 1, -10)
highlightedLabel.Position = UDim2.new(0, 5, 0, 5)
highlightedLabel.BackgroundTransparency = 1
highlightedLabel.TextXAlignment = Enum.TextXAlignment.Left
highlightedLabel.TextYAlignment = Enum.TextYAlignment.Top
highlightedLabel.Font = Enum.Font.Code
highlightedLabel.TextSize = 18
highlightedLabel.RichText = true
highlightedLabel.TextWrapped = true
highlightedLabel.Text = ""
highlightedLabel.Parent = editorContainer

-- Transparent multiline TextBox for editing text (overlays highlighted label)
local editor = Instance.new("TextBox")
editor.Size = UDim2.new(1, -10, 1, -10)
editor.Position = UDim2.new(0, 5, 0, 5)
editor.BackgroundTransparency = 1
editor.TextColor3 = Color3.new(1, 1, 1)
editor.Font = Enum.Font.Code
editor.TextSize = 18
editor.ClearTextOnFocus = false
editor.MultiLine = true
editor.TextWrapped = true
editor.Text = "-- Your Lua code here\nprint('Hello world')"
editor.Parent = editorContainer

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: