--// Synapse X style GUI (v2) - Fixed Execution, Infinite Yield & Smooth Resizing
--// X = hide window, press your toggle key (default P) = show again
--// Options = settings panel sliding in from the right (themes, text size, line numbers, keybind, eject)

local Players = game:GetService("Players")
local UserInputService = game:GetService("UserInputService")
local TweenService = game:GetService("TweenService")

-- Remove any previous copy so re-running doesn't stack windows
local function findOld(parent)
    local old = parent and parent:FindFirstChild("Synapse")
    if old then old:Destroy() end
end
pcall(function() findOld(game:GetService("CoreGui")) end)
pcall(function() findOld(Players.LocalPlayer:FindFirstChild("PlayerGui")) end)

local connections = {}
local function connect(signal, fn)
    local c = signal:Connect(fn)
    table.insert(connections, c)
    return c
end

----------------------------------------------------------------
-- Themes
----------------------------------------------------------------
local THEMES = {
    { name = "Default", bg = Color3.fromRGB(25, 23, 23), panel = Color3.fromRGB(35, 35, 35), accent = Color3.fromRGB(90, 90, 90) },
    { name = "Blue",    bg = Color3.fromRGB(14, 19, 31), panel = Color3.fromRGB(24, 36, 60), accent = Color3.fromRGB(70, 130, 255) },
    { name = "Red",     bg = Color3.fromRGB(30, 14, 14), panel = Color3.fromRGB(58, 25, 25), accent = Color3.fromRGB(225, 60, 60) },
    { name = "Green",   bg = Color3.fromRGB(14, 28, 18), panel = Color3.fromRGB(24, 52, 32), accent = Color3.fromRGB(60, 200, 100) },
    { name = "Purple",  bg = Color3.fromRGB(22, 14, 32), panel = Color3.fromRGB(44, 28, 66), accent = Color3.fromRGB(160, 90, 255) },
}

local COLOR_TEXT  = Color3.fromRGB(255, 255, 255)
local COLOR_MUTED = Color3.fromRGB(130, 130, 130)

local bgObjs, panelObjs, strokes = {}, {}, {}
local scroll -- assigned below, recolored by theme

local function applyTheme(theme)
    for _, o in ipairs(bgObjs) do o.BackgroundColor3 = theme.bg end
    for _, o in ipairs(panelObjs) do o.BackgroundColor3 = theme.panel end
    for _, s in ipairs(strokes) do s.Color = theme.accent end
    if scroll then scroll.ScrollBarImageColor3 = theme.accent end
end

----------------------------------------------------------------
-- Helpers
----------------------------------------------------------------
local function new(class, props, parent)
    local obj = Instance.new(class)
    for k, v in pairs(props) do obj[k] = v end
    obj.Parent = parent
    return obj
end

local function styleButton(btn)
    btn.AutoButtonColor = true
    btn.BorderSizePixel = 0
    btn.TextColor3 = COLOR_TEXT
    btn.TextSize = 14
    btn.Font = Enum.Font.SourceSans
end

----------------------------------------------------------------
-- ScreenGui
----------------------------------------------------------------
local gui = new("ScreenGui", {
    Name = "Synapse",
    ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
    IgnoreGuiInset = true,
    ResetOnSpawn = false,
})

local ok = pcall(function() gui.Parent = game:GetService("CoreGui") end)
if not ok then
    gui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
end

----------------------------------------------------------------
-- Main window
----------------------------------------------------------------
local main = new("Frame", {
    Name = "Main",
    BackgroundColor3 = THEMES[1].bg,
    BorderSizePixel = 0,
    Size = UDim2.new(0, 650, 0, 400),
    Position = UDim2.new(0.5, -325, 0.5, -200),
    ClipsDescendants = true,
}, gui)
new("UICorner", { CornerRadius = UDim.new(0, 6) }, main)
local uiScale = new("UIScale", {}, main)
table.insert(bgObjs, main)

-- Title bar (drag handle)
local drag = new("Frame", {
    Name = "Drag",
    Active = true,
    BackgroundColor3 = THEMES[1].panel,
    BorderSizePixel = 0,
    Size = UDim2.new(1, 0, 0, 32),
}, main)
new("UICorner", { CornerRadius = UDim.new(0, 6) }, drag)
table.insert(panelObjs, drag)

new("TextLabel", {
    Name = "Title",
    BackgroundTransparency = 1,
    Size = UDim2.new(1, 0, 1, 0),
    Text = "Synapse X",
    TextColor3 = COLOR_TEXT,
    TextSize = 20,
    Font = Enum.Font.SourceSansBold,
}, drag)

local closeBtn = new("TextButton", {
    Name = "Close",
    BackgroundTransparency = 1,
    BorderSizePixel = 0,
    Size = UDim2.new(0, 34, 0, 32),
    Position = UDim2.new(1, -34, 0, 0),
    Text = "X",
    TextColor3 = COLOR_TEXT,
    TextSize = 22,
    Font = Enum.Font.SourceSansBold,
    ZIndex = 5,
}, drag)

----------------------------------------------------------------
-- Editor
----------------------------------------------------------------
local editorHolder = new("Frame", {
    Name = "EditorHolder",
    BackgroundColor3 = THEMES[1].panel,
    BorderSizePixel = 0,
    Size = UDim2.new(1, -150, 1, -84),
    Position = UDim2.new(0, 8, 0, 40),
}, main)
table.insert(panelObjs, editorHolder)

scroll = new("ScrollingFrame", {
    Name = "Scroll",
    BackgroundTransparency = 1,
    BorderSizePixel = 0,
    Size = UDim2.new(1, 0, 1, 0),
    CanvasSize = UDim2.new(0, 0, 0, 0),
    AutomaticCanvasSize = Enum.AutomaticSize.XY,
    ScrollingDirection = Enum.ScrollingDirection.XY,
    ScrollBarThickness = 8,
    ScrollBarImageColor3 = THEMES[1].accent,
    ClipsDescendants = true,
}, editorHolder)

local gutter = 38 -- becomes 4 when line numbers are turned off

local lineNumbers = new("TextLabel", {
    Name = "LineNumbers",
    BackgroundTransparency = 1,
    Size = UDim2.new(0, 32, 0, 0),
    AutomaticSize = Enum.AutomaticSize.Y,
    Text = "1",
    TextColor3 = COLOR_MUTED,
    TextSize = 14,
    Font = Enum.Font.Code,
    TextXAlignment = Enum.TextXAlignment.Right,
    TextYAlignment = Enum.TextYAlignment.Top,
}, scroll)

local textbox = new("TextBox", {
    Name = "ScriptBox",
    BackgroundTransparency = 1,
    BorderSizePixel = 0,
    Position = UDim2.new(0, gutter, 0, 0),
    Size = UDim2.new(1, -gutter, 1, 0),
    AutomaticSize = Enum.AutomaticSize.XY,
    Text = "",
    TextColor3 = COLOR_TEXT,
    TextSize = 14,
    Font = Enum.Font.Code,
    TextXAlignment = Enum.TextXAlignment.Left,
    TextYAlignment = Enum.TextYAlignment.Top,
    TextWrapped = false,
    MultiLine = true,
    ClearTextOnFocus = false,
}, scroll)

local function updateLineNumbers()
    local _, count = string.gsub(textbox.Text, "\n", "\n")
    local lines = table.create(count + 1)
    for i = 1, count + 1 do lines[i] = tostring(i) end
    lineNumbers.Text = table.concat(lines, "\n")
end
connect(textbox:GetPropertyChangedSignal("Text"), updateLineNumbers)
updateLineNumbers()

----------------------------------------------------------------
-- Right sidebar
----------------------------------------------------------------
local sidebar = new("Frame", {
    Name = "Sidebar",
    BackgroundColor3 = THEMES[1].panel,
    BorderSizePixel = 0,
    Size = UDim2.new(0, 123, 1, -84),
    Position = UDim2.new(1, -131, 0, 40),
}, main)
table.insert(panelObjs, sidebar)

local infiniteYield = new("TextButton", {
    Name = "InfiniteYield",
    Size = UDim2.new(1, -16, 0, 30),
    Position = UDim2.new(0, 8, 0, 8),
    Text = "infinite yield",
}, sidebar)
styleButton(infiniteYield)
infiniteYield.BackgroundColor3 = THEMES[1].bg
table.insert(bgObjs, infiniteYield)

-- Infinite Yield button functionality
connect(infiniteYield.MouseButton1Click, function()
    pcall(function()
        loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))()
    end)
end)

----------------------------------------------------------------
-- Bottom bar
----------------------------------------------------------------
new("TextLabel", {
    Name = "Icon",
    BackgroundTransparency = 1,
    Size = UDim2.new(0, 40, 0, 27),
    Position = UDim2.new(0, 12, 1, -35),
    Text = "<>",
    TextColor3 = COLOR_TEXT,
    TextSize = 22,
    Font = Enum.Font.SourceSansBold,
}, main)

local function bottomButton(name, text, pos)
    local b = new("TextButton", {
        Name = name,
        Size = UDim2.new(0, 123, 0, 27),
        Position = pos,
        Text = text,
    }, main)
    styleButton(b)
    b.BackgroundColor3 = THEMES[1].panel
    table.insert(panelObjs, b)
    return b
end

local executeBtn = bottomButton("Execute", "Execute", UDim2.new(0, 60, 1, -35))
local clearBtn   = bottomButton("Clear", "Clear", UDim2.new(0, 190, 1, -35))
local optionsBtn = bottomButton("Options", "Options", UDim2.new(1, -131, 1, -35))

connect(clearBtn.MouseButton1Click, function()
    textbox.Text = ""
end)

-- Execute button functionality
connect(executeBtn.MouseButton1Click, function()
    local func, err = loadstring(textbox.Text)
    if func then
        pcall(func)
    else
        warn("Execution Error: " .. tostring(err))
    end
end)

----------------------------------------------------------------
-- Settings panel (slides in from the right)
----------------------------------------------------------------
local PANEL_W = 210
local settingsOpen = false

local settings = new("Frame", {
    Name = "Settings",
    BackgroundColor3 = THEMES[1].bg,
    BorderSizePixel = 0,
    Size = UDim2.new(0, PANEL_W, 1, -32),
    Position = UDim2.new(1, 0, 0, 32), -- off-screen (clipped by Main)
    ZIndex = 10,
    Visible = false,
}, main)
new("UICorner", { CornerRadius = UDim.new(0, 6) }, settings)
table.insert(bgObjs, settings)
local settingsStroke = new("UIStroke", { Color = THEMES[1].accent, Thickness = 1 }, settings)
table.insert(strokes, settingsStroke)
new("UIPadding", {
    PaddingTop = UDim.new(0, 8), PaddingLeft = UDim.new(0, 8),
    PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 8),
}, settings)

local content = new("Frame", {
    Name = "Content",
    BackgroundTransparency = 1,
    Size = UDim2.new(1, 0, 1, -36),
    ZIndex = 10,
}, settings)
new("UIListLayout", {
    Padding = UDim.new(0, 6),
    SortOrder = Enum.SortOrder.LayoutOrder,
}, content)

local order = 0
local function nextOrder() order += 1 return order end

local function label(text, height, size, font)
    return new("TextLabel", {
        BackgroundTransparency = 1,
        Size = UDim2.new(1, 0, 0, height or 18),
        Text = text,
        TextColor3 = COLOR_TEXT,
        TextSize = size or 14,
        Font = font or Enum.Font.SourceSans,
        TextXAlignment = Enum.TextXAlignment.Left,
        LayoutOrder = nextOrder(),
        ZIndex = 10,
    }, content)
end

local function settingsButton(text, parent, size)
    local b = new("TextButton", {
        Size = size or UDim2.new(1, 0, 0, 28),
        Text = text,
        ZIndex = 10,
    }, parent or content)
    styleButton(b)
    b.BackgroundColor3 = THEMES[1].panel
    table.insert(panelObjs, b)
    if not parent then b.LayoutOrder = nextOrder() end
    return b
end

label("Settings", 22, 18, Enum.Font.SourceSansBold)

-- Theme picker
label("Theme", 16, 13).TextColor3 = COLOR_MUTED
local themeGrid = new("Frame", {
    BackgroundTransparency = 1,
    Size = UDim2.new(1, 0, 0, 56),
    LayoutOrder = nextOrder(),
    ZIndex = 10,
}, content)
new("UIGridLayout", {
    CellSize = UDim2.new(0, 60, 0, 26),
    CellPadding = UDim2.new(0, 4, 0, 4),
    SortOrder = Enum.SortOrder.LayoutOrder,
}, themeGrid)
for i, theme in ipairs(THEMES) do
    local b = settingsButton(theme.name, themeGrid, UDim2.new(0, 60, 0, 26))
    b.LayoutOrder = i
    connect(b.MouseButton1Click, function() applyTheme(theme) end)
end

-- Text size
label("Editor", 16, 13).TextColor3 = COLOR_MUTED
local sizeRow = new("Frame", {
    BackgroundTransparency = 1,
    Size = UDim2.new(1, 0, 0, 28),
    LayoutOrder = nextOrder(),
    ZIndex = 10,
}, content)
local sizeLabel = new("TextLabel", {
    BackgroundTransparency = 1,
    Size = UDim2.new(1, -64, 1, 0),
    Text = "Text size: 14",
    TextColor3 = COLOR_TEXT,
    TextSize = 14,
    Font = Enum.Font.SourceSans,
    TextXAlignment = Enum.TextXAlignment.Left,
    ZIndex = 10,
}, sizeRow)
local minusBtn = settingsButton("-", sizeRow, UDim2.new(0, 28, 0, 28))
minusBtn.Position = UDim2.new(1, -60, 0, 0)
local plusBtn = settingsButton("+", sizeRow, UDim2.new(0, 28, 0, 28))
plusBtn.Position = UDim2.new(1, -28, 0, 0)

local function setTextSize(n)
    n = math.clamp(n, 10, 24)
    textbox.TextSize = n
    lineNumbers.TextSize = n
    sizeLabel.Text = "Text size: " .. n
end
connect(minusBtn.MouseButton1Click, function() setTextSize(textbox.TextSize - 1) end)
connect(plusBtn.MouseButton1Click, function() setTextSize(textbox.TextSize + 1) end)

-- Line numbers toggle
local lineBtn = settingsButton("Line numbers: On")
local function setLineNumbers(on)
    lineNumbers.Visible = on
    gutter = on and 38 or 4
    textbox.Position = UDim2.new(0, gutter, 0, 0)
    textbox.Size = UDim2.new(1, -gutter, 1, 0)
    lineBtn.Text = "Line numbers: " .. (on and "On" or "Off")
end
local lineNumbersOn = true
connect(lineBtn.MouseButton1Click, function()
    lineNumbersOn = not lineNumbersOn
    setLineNumbers(lineNumbersOn)
end)

-- Toggle key
label("Window", 16, 13).TextColor3 = COLOR_MUTED
local toggleKey = Enum.KeyCode.P
local binding = false
local keyBtn = settingsButton("Toggle key: P")
connect(keyBtn.MouseButton1Click, function()
    binding = true
    keyBtn.Text = "Press a key... (Esc cancels)"
end)

label("X hides the window. Press the key to show it again.", 34, 12).TextWrapped = true

-- Eject (bottom of the panel)
local ejectBtn = new("TextButton", {
    Name = "Eject",
    AnchorPoint = Vector2.new(0, 1),
    Position = UDim2.new(0, 0, 1, 0),
    Size = UDim2.new(1, 0, 0, 30),
    Text = "Eject (destroy GUI)",
    ZIndex = 10,
}, settings)
styleButton(ejectBtn)
ejectBtn.BackgroundColor3 = Color3.fromRGB(150, 35, 35)

-- Slide animation
local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
local function setSettingsOpen(open)
    settingsOpen = open
    if open then
        settings.Visible = true
        TweenService:Create(settings, tweenInfo, { Position = UDim2.new(1, -PANEL_W - 4, 0, 32) }):Play()
    else
        local t = TweenService:Create(settings, tweenInfo, { Position = UDim2.new(1, 0, 0, 32) })
        t:Play()
        t.Completed:Once(function()
            if not settingsOpen then settings.Visible = false end
        end)
    end
end
connect(optionsBtn.MouseButton1Click, function() setSettingsOpen(not settingsOpen) end)

-- X button in the settings panel header
local settingsClose = new("TextButton", {
    Name = "SettingsClose",
    BackgroundTransparency = 1,
    BorderSizePixel = 0,
    AnchorPoint = Vector2.new(1, 0),
    Position = UDim2.new(1, 0, 0, 0),
    Size = UDim2.new(0, 26, 0, 22),
    Text = "X",
    TextColor3 = COLOR_TEXT,
    TextSize = 20,
    Font = Enum.Font.SourceSansBold,
    ZIndex = 12,
}, settings)
connect(settingsClose.MouseButton1Click, function() setSettingsOpen(false) end)

----------------------------------------------------------------
-- Hide / show / eject
----------------------------------------------------------------
local dragging, dragStart, startPos = false, nil, nil

local function setVisible(v)
    gui.Enabled = v
    if not v then
        dragging = false
        textbox:ReleaseFocus()
    end
end

local function eject()
    for _, c in ipairs(connections) do
        pcall(function() c:Disconnect() end)
    end
    table.clear(connections)
    gui:Destroy()
end

connect(closeBtn.MouseButton1Click, function() setVisible(false) end)
connect(ejectBtn.MouseButton1Click, eject)

connect(UserInputService.InputBegan, function(input, gameProcessed)
    -- rebinding the toggle key
    if binding then
        if input.UserInputType == Enum.UserInputType.Keyboard then
            if input.KeyCode ~= Enum.KeyCode.Escape then
                toggleKey = input.KeyCode
            end
            keyBtn.Text = "Toggle key: " .. toggleKey.Name
            binding = false
        end
        return
    end

    if gameProcessed then return end -- ignores typing in the textbox / chat
    if input.KeyCode == toggleKey then
        setVisible(not gui.Enabled)
    end
end)

----------------------------------------------------------------
-- Dragging & Smooth Resizing (Corner Grip)
----------------------------------------------------------------
local resizing = false
local resizeStartMouse, resizeStartSize

-- Bottom-right resize grip handle
local resizeHandle = new("TextButton", {
    Name = "ResizeHandle",
    BackgroundTransparency = 1,
    Size = UDim2.new(0, 24, 0, 24),
    Position = UDim2.new(1, -24, 1, -24),
    Text = "",
    ZIndex = 25,
}, main)

connect(resizeHandle.MouseButton1Down, function()
    if gui.Enabled then
        resizing = true
        resizeStartMouse = UserInputService:GetMouseLocation()
        resizeStartSize = main.AbsoluteSize
    end
end)

connect(drag.InputBegan, function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = true
        dragStart = input.Position
        startPos = main.Position
    end
end)

connect(UserInputService.InputChanged, function(input)
    if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
        if dragging then
            local delta = input.Position - dragStart
            main.Position = UDim2.new(
                startPos.X.Scale, startPos.X.Offset + delta.X / uiScale.Scale,
                startPos.Y.Scale, startPos.Y.Offset + delta.Y / uiScale.Scale
            )
        elseif resizing then
            local currentMouse = UserInputService:GetMouseLocation()
            local delta = (currentMouse - resizeStartMouse) / uiScale.Scale
            local newW = math.clamp(resizeStartSize.X + delta.X, 450, 1200)
            local newH = math.clamp(resizeStartSize.Y + delta.Y, 250, 800)
            main.Size = UDim2.new(0, newW, 0, newH)
        end
    end
end)

connect(UserInputService.InputEnded, function(input)
    if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
        dragging = false
        resizing = false
    end
end)

----------------------------------------------------------------
-- Auto scaling
----------------------------------------------------------------
local camera = workspace.CurrentCamera
local function updateScale()
    local scale = camera.ViewportSize.Y / 1080
    uiScale.Scale = math.clamp(scale, 0.5, 2.5)
end
updateScale()
connect(camera:GetPropertyChangedSignal("ViewportSize"), updateScale)

applyTheme(THEMES[1])

return gui
Universal Script 🎭
undefined Synapse X
420views
1 months ago

Synapse X

Status
Working
Price
Free

Description

fake synapse X its not that bad but the gui was made in roblox studio but the features was videcoded FOR ME TO BE ABLE TO PUBLISH THE SCRIPT SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS

Features

4
  • executor
  • settings
  • clear
  • preference

Related Scripts