--// 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 guifake 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
1--// Synapse X style GUI (v2) - Fixed Execution, Infinite Yield & Smooth Resizing
2--// X = hide window, press your toggle key (default P) = show again
3--// Options = settings panel sliding in from the right (themes, text size, line numbers, keybind, eject)
4
5local Players = game:GetService("Players")
6local UserInputService = game:GetService("UserInputService")
7local TweenService = game:GetService("TweenService")
8
9-- Remove any previous copy so re-running doesn't stack windows
10local function findOld(parent)
11 local old = parent and parent:FindFirstChild("Synapse")
12 if old then old:Destroy() end
13end
14pcall(function() findOld(game:GetService("CoreGui")) end)
15pcall(function() findOld(Players.LocalPlayer:FindFirstChild("PlayerGui")) end)
16
17local connections = {}
18local function connect(signal, fn)
19 local c = signal:Connect(fn)
20 table.insert(connections, c)
21 return c
22end
23
24----------------------------------------------------------------
25-- Themes
26----------------------------------------------------------------
27local THEMES = {
28 { name = "Default", bg = Color3.fromRGB(25, 23, 23), panel = Color3.fromRGB(35, 35, 35), accent = Color3.fromRGB(90, 90, 90) },
29 { name = "Blue", bg = Color3.fromRGB(14, 19, 31), panel = Color3.fromRGB(24, 36, 60), accent = Color3.fromRGB(70, 130, 255) },
30 { name = "Red", bg = Color3.fromRGB(30, 14, 14), panel = Color3.fromRGB(58, 25, 25), accent = Color3.fromRGB(225, 60, 60) },
31 { name = "Green", bg = Color3.fromRGB(14, 28, 18), panel = Color3.fromRGB(24, 52, 32), accent = Color3.fromRGB(60, 200, 100) },
32 { name = "Purple", bg = Color3.fromRGB(22, 14, 32), panel = Color3.fromRGB(44, 28, 66), accent = Color3.fromRGB(160, 90, 255) },
33}
34
35local COLOR_TEXT = Color3.fromRGB(255, 255, 255)
36local COLOR_MUTED = Color3.fromRGB(130, 130, 130)
37
38local bgObjs, panelObjs, strokes = {}, {}, {}
39local scroll -- assigned below, recolored by theme
40
41local function applyTheme(theme)
42 for _, o in ipairs(bgObjs) do o.BackgroundColor3 = theme.bg end
43 for _, o in ipairs(panelObjs) do o.BackgroundColor3 = theme.panel end
44 for _, s in ipairs(strokes) do s.Color = theme.accent end
45 if scroll then scroll.ScrollBarImageColor3 = theme.accent end
46end
47
48----------------------------------------------------------------
49-- Helpers
50----------------------------------------------------------------
51local function new(class, props, parent)
52 local obj = Instance.new(class)
53 for k, v in pairs(props) do obj[k] = v end
54 obj.Parent = parent
55 return obj
56end
57
58local function styleButton(btn)
59 btn.AutoButtonColor = true
60 btn.BorderSizePixel = 0
61 btn.TextColor3 = COLOR_TEXT
62 btn.TextSize = 14
63 btn.Font = Enum.Font.SourceSans
64end
65
66----------------------------------------------------------------
67-- ScreenGui
68----------------------------------------------------------------
69local gui = new("ScreenGui", {
70 Name = "Synapse",
71 ZIndexBehavior = Enum.ZIndexBehavior.Sibling,
72 IgnoreGuiInset = true,
73 ResetOnSpawn = false,
74})
75
76local ok = pcall(function() gui.Parent = game:GetService("CoreGui") end)
77if not ok then
78 gui.Parent = Players.LocalPlayer:WaitForChild("PlayerGui")
79end
80
81----------------------------------------------------------------
82-- Main window
83----------------------------------------------------------------
84local main = new("Frame", {
85 Name = "Main",
86 BackgroundColor3 = THEMES[1].bg,
87 BorderSizePixel = 0,
88 Size = UDim2.new(0, 650, 0, 400),
89 Position = UDim2.new(0.5, -325, 0.5, -200),
90 ClipsDescendants = true,
91}, gui)
92new("UICorner", { CornerRadius = UDim.new(0, 6) }, main)
93local uiScale = new("UIScale", {}, main)
94table.insert(bgObjs, main)
95
96-- Title bar (drag handle)
97local drag = new("Frame", {
98 Name = "Drag",
99 Active = true,
100 BackgroundColor3 = THEMES[1].panel,
101 BorderSizePixel = 0,
102 Size = UDim2.new(1, 0, 0, 32),
103}, main)
104new("UICorner", { CornerRadius = UDim.new(0, 6) }, drag)
105table.insert(panelObjs, drag)
106
107new("TextLabel", {
108 Name = "Title",
109 BackgroundTransparency = 1,
110 Size = UDim2.new(1, 0, 1, 0),
111 Text = "Synapse X",
112 TextColor3 = COLOR_TEXT,
113 TextSize = 20,
114 Font = Enum.Font.SourceSansBold,
115}, drag)
116
117local closeBtn = new("TextButton", {
118 Name = "Close",
119 BackgroundTransparency = 1,
120 BorderSizePixel = 0,
121 Size = UDim2.new(0, 34, 0, 32),
122 Position = UDim2.new(1, -34, 0, 0),
123 Text = "X",
124 TextColor3 = COLOR_TEXT,
125 TextSize = 22,
126 Font = Enum.Font.SourceSansBold,
127 ZIndex = 5,
128}, drag)
129
130----------------------------------------------------------------
131-- Editor
132----------------------------------------------------------------
133local editorHolder = new("Frame", {
134 Name = "EditorHolder",
135 BackgroundColor3 = THEMES[1].panel,
136 BorderSizePixel = 0,
137 Size = UDim2.new(1, -150, 1, -84),
138 Position = UDim2.new(0, 8, 0, 40),
139}, main)
140table.insert(panelObjs, editorHolder)
141
142scroll = new("ScrollingFrame", {
143 Name = "Scroll",
144 BackgroundTransparency = 1,
145 BorderSizePixel = 0,
146 Size = UDim2.new(1, 0, 1, 0),
147 CanvasSize = UDim2.new(0, 0, 0, 0),
148 AutomaticCanvasSize = Enum.AutomaticSize.XY,
149 ScrollingDirection = Enum.ScrollingDirection.XY,
150 ScrollBarThickness = 8,
151 ScrollBarImageColor3 = THEMES[1].accent,
152 ClipsDescendants = true,
153}, editorHolder)
154
155local gutter = 38 -- becomes 4 when line numbers are turned off
156
157local lineNumbers = new("TextLabel", {
158 Name = "LineNumbers",
159 BackgroundTransparency = 1,
160 Size = UDim2.new(0, 32, 0, 0),
161 AutomaticSize = Enum.AutomaticSize.Y,
162 Text = "1",
163 TextColor3 = COLOR_MUTED,
164 TextSize = 14,
165 Font = Enum.Font.Code,
166 TextXAlignment = Enum.TextXAlignment.Right,
167 TextYAlignment = Enum.TextYAlignment.Top,
168}, scroll)
169
170local textbox = new("TextBox", {
171 Name = "ScriptBox",
172 BackgroundTransparency = 1,
173 BorderSizePixel = 0,
174 Position = UDim2.new(0, gutter, 0, 0),
175 Size = UDim2.new(1, -gutter, 1, 0),
176 AutomaticSize = Enum.AutomaticSize.XY,
177 Text = "",
178 TextColor3 = COLOR_TEXT,
179 TextSize = 14,
180 Font = Enum.Font.Code,
181 TextXAlignment = Enum.TextXAlignment.Left,
182 TextYAlignment = Enum.TextYAlignment.Top,
183 TextWrapped = false,
184 MultiLine = true,
185 ClearTextOnFocus = false,
186}, scroll)
187
188local function updateLineNumbers()
189 local _, count = string.gsub(textbox.Text, "\n", "\n")
190 local lines = table.create(count + 1)
191 for i = 1, count + 1 do lines[i] = tostring(i) end
192 lineNumbers.Text = table.concat(lines, "\n")
193end
194connect(textbox:GetPropertyChangedSignal("Text"), updateLineNumbers)
195updateLineNumbers()
196
197----------------------------------------------------------------
198-- Right sidebar
199----------------------------------------------------------------
200local sidebar = new("Frame", {
201 Name = "Sidebar",
202 BackgroundColor3 = THEMES[1].panel,
203 BorderSizePixel = 0,
204 Size = UDim2.new(0, 123, 1, -84),
205 Position = UDim2.new(1, -131, 0, 40),
206}, main)
207table.insert(panelObjs, sidebar)
208
209local infiniteYield = new("TextButton", {
210 Name = "InfiniteYield",
211 Size = UDim2.new(1, -16, 0, 30),
212 Position = UDim2.new(0, 8, 0, 8),
213 Text = "infinite yield",
214}, sidebar)
215styleButton(infiniteYield)
216infiniteYield.BackgroundColor3 = THEMES[1].bg
217table.insert(bgObjs, infiniteYield)
218
219-- Infinite Yield button functionality
220connect(infiniteYield.MouseButton1Click, function()
221 pcall(function()
222 loadstring(game:HttpGet('https://raw.githubusercontent.com/EdgeIY/infiniteyield/master/source'))()
223 end)
224end)
225
226----------------------------------------------------------------
227-- Bottom bar
228----------------------------------------------------------------
229new("TextLabel", {
230 Name = "Icon",
231 BackgroundTransparency = 1,
232 Size = UDim2.new(0, 40, 0, 27),
233 Position = UDim2.new(0, 12, 1, -35),
234 Text = "<>",
235 TextColor3 = COLOR_TEXT,
236 TextSize = 22,
237 Font = Enum.Font.SourceSansBold,
238}, main)
239
240local function bottomButton(name, text, pos)
241 local b = new("TextButton", {
242 Name = name,
243 Size = UDim2.new(0, 123, 0, 27),
244 Position = pos,
245 Text = text,
246 }, main)
247 styleButton(b)
248 b.BackgroundColor3 = THEMES[1].panel
249 table.insert(panelObjs, b)
250 return b
251end
252
253local executeBtn = bottomButton("Execute", "Execute", UDim2.new(0, 60, 1, -35))
254local clearBtn = bottomButton("Clear", "Clear", UDim2.new(0, 190, 1, -35))
255local optionsBtn = bottomButton("Options", "Options", UDim2.new(1, -131, 1, -35))
256
257connect(clearBtn.MouseButton1Click, function()
258 textbox.Text = ""
259end)
260
261-- Execute button functionality
262connect(executeBtn.MouseButton1Click, function()
263 local func, err = loadstring(textbox.Text)
264 if func then
265 pcall(func)
266 else
267 warn("Execution Error: " .. tostring(err))
268 end
269end)
270
271----------------------------------------------------------------
272-- Settings panel (slides in from the right)
273----------------------------------------------------------------
274local PANEL_W = 210
275local settingsOpen = false
276
277local settings = new("Frame", {
278 Name = "Settings",
279 BackgroundColor3 = THEMES[1].bg,
280 BorderSizePixel = 0,
281 Size = UDim2.new(0, PANEL_W, 1, -32),
282 Position = UDim2.new(1, 0, 0, 32), -- off-screen (clipped by Main)
283 ZIndex = 10,
284 Visible = false,
285}, main)
286new("UICorner", { CornerRadius = UDim.new(0, 6) }, settings)
287table.insert(bgObjs, settings)
288local settingsStroke = new("UIStroke", { Color = THEMES[1].accent, Thickness = 1 }, settings)
289table.insert(strokes, settingsStroke)
290new("UIPadding", {
291 PaddingTop = UDim.new(0, 8), PaddingLeft = UDim.new(0, 8),
292 PaddingRight = UDim.new(0, 8), PaddingBottom = UDim.new(0, 8),
293}, settings)
294
295local content = new("Frame", {
296 Name = "Content",
297 BackgroundTransparency = 1,
298 Size = UDim2.new(1, 0, 1, -36),
299 ZIndex = 10,
300}, settings)
301new("UIListLayout", {
302 Padding = UDim.new(0, 6),
303 SortOrder = Enum.SortOrder.LayoutOrder,
304}, content)
305
306local order = 0
307local function nextOrder() order += 1 return order end
308
309local function label(text, height, size, font)
310 return new("TextLabel", {
311 BackgroundTransparency = 1,
312 Size = UDim2.new(1, 0, 0, height or 18),
313 Text = text,
314 TextColor3 = COLOR_TEXT,
315 TextSize = size or 14,
316 Font = font or Enum.Font.SourceSans,
317 TextXAlignment = Enum.TextXAlignment.Left,
318 LayoutOrder = nextOrder(),
319 ZIndex = 10,
320 }, content)
321end
322
323local function settingsButton(text, parent, size)
324 local b = new("TextButton", {
325 Size = size or UDim2.new(1, 0, 0, 28),
326 Text = text,
327 ZIndex = 10,
328 }, parent or content)
329 styleButton(b)
330 b.BackgroundColor3 = THEMES[1].panel
331 table.insert(panelObjs, b)
332 if not parent then b.LayoutOrder = nextOrder() end
333 return b
334end
335
336label("Settings", 22, 18, Enum.Font.SourceSansBold)
337
338-- Theme picker
339label("Theme", 16, 13).TextColor3 = COLOR_MUTED
340local themeGrid = new("Frame", {
341 BackgroundTransparency = 1,
342 Size = UDim2.new(1, 0, 0, 56),
343 LayoutOrder = nextOrder(),
344 ZIndex = 10,
345}, content)
346new("UIGridLayout", {
347 CellSize = UDim2.new(0, 60, 0, 26),
348 CellPadding = UDim2.new(0, 4, 0, 4),
349 SortOrder = Enum.SortOrder.LayoutOrder,
350}, themeGrid)
351for i, theme in ipairs(THEMES) do
352 local b = settingsButton(theme.name, themeGrid, UDim2.new(0, 60, 0, 26))
353 b.LayoutOrder = i
354 connect(b.MouseButton1Click, function() applyTheme(theme) end)
355end
356
357-- Text size
358label("Editor", 16, 13).TextColor3 = COLOR_MUTED
359local sizeRow = new("Frame", {
360 BackgroundTransparency = 1,
361 Size = UDim2.new(1, 0, 0, 28),
362 LayoutOrder = nextOrder(),
363 ZIndex = 10,
364}, content)
365local sizeLabel = new("TextLabel", {
366 BackgroundTransparency = 1,
367 Size = UDim2.new(1, -64, 1, 0),
368 Text = "Text size: 14",
369 TextColor3 = COLOR_TEXT,
370 TextSize = 14,
371 Font = Enum.Font.SourceSans,
372 TextXAlignment = Enum.TextXAlignment.Left,
373 ZIndex = 10,
374}, sizeRow)
375local minusBtn = settingsButton("-", sizeRow, UDim2.new(0, 28, 0, 28))
376minusBtn.Position = UDim2.new(1, -60, 0, 0)
377local plusBtn = settingsButton("+", sizeRow, UDim2.new(0, 28, 0, 28))
378plusBtn.Position = UDim2.new(1, -28, 0, 0)
379
380local function setTextSize(n)
381 n = math.clamp(n, 10, 24)
382 textbox.TextSize = n
383 lineNumbers.TextSize = n
384 sizeLabel.Text = "Text size: " .. n
385end
386connect(minusBtn.MouseButton1Click, function() setTextSize(textbox.TextSize - 1) end)
387connect(plusBtn.MouseButton1Click, function() setTextSize(textbox.TextSize + 1) end)
388
389-- Line numbers toggle
390local lineBtn = settingsButton("Line numbers: On")
391local function setLineNumbers(on)
392 lineNumbers.Visible = on
393 gutter = on and 38 or 4
394 textbox.Position = UDim2.new(0, gutter, 0, 0)
395 textbox.Size = UDim2.new(1, -gutter, 1, 0)
396 lineBtn.Text = "Line numbers: " .. (on and "On" or "Off")
397end
398local lineNumbersOn = true
399connect(lineBtn.MouseButton1Click, function()
400 lineNumbersOn = not lineNumbersOn
401 setLineNumbers(lineNumbersOn)
402end)
403
404-- Toggle key
405label("Window", 16, 13).TextColor3 = COLOR_MUTED
406local toggleKey = Enum.KeyCode.P
407local binding = false
408local keyBtn = settingsButton("Toggle key: P")
409connect(keyBtn.MouseButton1Click, function()
410 binding = true
411 keyBtn.Text = "Press a key... (Esc cancels)"
412end)
413
414label("X hides the window. Press the key to show it again.", 34, 12).TextWrapped = true
415
416-- Eject (bottom of the panel)
417local ejectBtn = new("TextButton", {
418 Name = "Eject",
419 AnchorPoint = Vector2.new(0, 1),
420 Position = UDim2.new(0, 0, 1, 0),
421 Size = UDim2.new(1, 0, 0, 30),
422 Text = "Eject (destroy GUI)",
423 ZIndex = 10,
424}, settings)
425styleButton(ejectBtn)
426ejectBtn.BackgroundColor3 = Color3.fromRGB(150, 35, 35)
427
428-- Slide animation
429local tweenInfo = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.Out)
430local function setSettingsOpen(open)
431 settingsOpen = open
432 if open then
433 settings.Visible = true
434 TweenService:Create(settings, tweenInfo, { Position = UDim2.new(1, -PANEL_W - 4, 0, 32) }):Play()
435 else
436 local t = TweenService:Create(settings, tweenInfo, { Position = UDim2.new(1, 0, 0, 32) })
437 t:Play()
438 t.Completed:Once(function()
439 if not settingsOpen then settings.Visible = false end
440 end)
441 end
442end
443connect(optionsBtn.MouseButton1Click, function() setSettingsOpen(not settingsOpen) end)
444
445-- X button in the settings panel header
446local settingsClose = new("TextButton", {
447 Name = "SettingsClose",
448 BackgroundTransparency = 1,
449 BorderSizePixel = 0,
450 AnchorPoint = Vector2.new(1, 0),
451 Position = UDim2.new(1, 0, 0, 0),
452 Size = UDim2.new(0, 26, 0, 22),
453 Text = "X",
454 TextColor3 = COLOR_TEXT,
455 TextSize = 20,
456 Font = Enum.Font.SourceSansBold,
457 ZIndex = 12,
458}, settings)
459connect(settingsClose.MouseButton1Click, function() setSettingsOpen(false) end)
460
461----------------------------------------------------------------
462-- Hide / show / eject
463----------------------------------------------------------------
464local dragging, dragStart, startPos = false, nil, nil
465
466local function setVisible(v)
467 gui.Enabled = v
468 if not v then
469 dragging = false
470 textbox:ReleaseFocus()
471 end
472end
473
474local function eject()
475 for _, c in ipairs(connections) do
476 pcall(function() c:Disconnect() end)
477 end
478 table.clear(connections)
479 gui:Destroy()
480end
481
482connect(closeBtn.MouseButton1Click, function() setVisible(false) end)
483connect(ejectBtn.MouseButton1Click, eject)
484
485connect(UserInputService.InputBegan, function(input, gameProcessed)
486 -- rebinding the toggle key
487 if binding then
488 if input.UserInputType == Enum.UserInputType.Keyboard then
489 if input.KeyCode ~= Enum.KeyCode.Escape then
490 toggleKey = input.KeyCode
491 end
492 keyBtn.Text = "Toggle key: " .. toggleKey.Name
493 binding = false
494 end
495 return
496 end
497
498 if gameProcessed then return end -- ignores typing in the textbox / chat
499 if input.KeyCode == toggleKey then
500 setVisible(not gui.Enabled)
501 end
502end)
503
504----------------------------------------------------------------
505-- Dragging & Smooth Resizing (Corner Grip)
506----------------------------------------------------------------
507local resizing = false
508local resizeStartMouse, resizeStartSize
509
510-- Bottom-right resize grip handle
511local resizeHandle = new("TextButton", {
512 Name = "ResizeHandle",
513 BackgroundTransparency = 1,
514 Size = UDim2.new(0, 24, 0, 24),
515 Position = UDim2.new(1, -24, 1, -24),
516 Text = "",
517 ZIndex = 25,
518}, main)
519
520connect(resizeHandle.MouseButton1Down, function()
521 if gui.Enabled then
522 resizing = true
523 resizeStartMouse = UserInputService:GetMouseLocation()
524 resizeStartSize = main.AbsoluteSize
525 end
526end)
527
528connect(drag.InputBegan, function(input)
529 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
530 dragging = true
531 dragStart = input.Position
532 startPos = main.Position
533 end
534end)
535
536connect(UserInputService.InputChanged, function(input)
537 if input.UserInputType == Enum.UserInputType.MouseMovement or input.UserInputType == Enum.UserInputType.Touch then
538 if dragging then
539 local delta = input.Position - dragStart
540 main.Position = UDim2.new(
541 startPos.X.Scale, startPos.X.Offset + delta.X / uiScale.Scale,
542 startPos.Y.Scale, startPos.Y.Offset + delta.Y / uiScale.Scale
543 )
544 elseif resizing then
545 local currentMouse = UserInputService:GetMouseLocation()
546 local delta = (currentMouse - resizeStartMouse) / uiScale.Scale
547 local newW = math.clamp(resizeStartSize.X + delta.X, 450, 1200)
548 local newH = math.clamp(resizeStartSize.Y + delta.Y, 250, 800)
549 main.Size = UDim2.new(0, newW, 0, newH)
550 end
551 end
552end)
553
554connect(UserInputService.InputEnded, function(input)
555 if input.UserInputType == Enum.UserInputType.MouseButton1 or input.UserInputType == Enum.UserInputType.Touch then
556 dragging = false
557 resizing = false
558 end
559end)
560
561----------------------------------------------------------------
562-- Auto scaling
563----------------------------------------------------------------
564local camera = workspace.CurrentCamera
565local function updateScale()
566 local scale = camera.ViewportSize.Y / 1080
567 uiScale.Scale = math.clamp(scale, 0.5, 2.5)
568end
569updateScale()
570connect(camera:GetPropertyChangedSignal("ViewportSize"), updateScale)
571
572applyTheme(THEMES[1])
573
574return gui