Key automation
Key Required

Key automation

[2x๐Ÿ€]Broken Blade[Dragon]dfhdfbdbfbdbdfbdfbdfhdfbdbfbdbdfbdfb 1.6K views 285 executesUpdated Jun 14, 2026
5.0/ 5(1 votes)
10100% Positive
Lua Scriptโ€ข389 lines (11990 chars)
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local TweenService = game:GetService("TweenService")
local Players = game:GetService("Players")

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

-- Settings
local enabled = false
local intervals = { V = 0.10, R = 0.10, Z = 0.75, X = 1.0, C = 1.0 }
local keyEnabled = { V = true, R = true, Z = true, X = false, C = false }
local keyCodes = {
    V = Enum.KeyCode.V, R = Enum.KeyCode.R,
    Z = Enum.KeyCode.Z, X = Enum.KeyCode.X, C = Enum.KeyCode.C
}
local timers = { V = 0, R = 0, Z = 0, X = 0, C = 0 }

local ACCENT       = Color3.fromRGB(200, 200, 200)
local ACCENT_ON    = Color3.fromRGB(180, 255, 180)
local BG_MAIN      = Color3.fromRGB(14, 14, 14)
local BG_PANEL     = Color3.fromRGB(20, 20, 20)
local BG_CARD      = Color3.fromRGB(28, 28, 28)
local BG_INPUT     = Color3.fromRGB(18, 18, 18)
local TEXT_PRIMARY = Color3.fromRGB(235, 235, 235)
local TEXT_MUTED   = Color3.fromRGB(100, 100, 100)
local TEXT_ACCENT  = Color3.fromRGB(190, 190, 190)
local BORDER       = Color3.fromRGB(45, 45, 45)

local function pressKey(keyCode)
    local vim = game:GetService("VirtualInputManager")
    vim:SendKeyEvent(true, keyCode, false, game)
    task.wait()
    vim:SendKeyEvent(false, keyCode, false, game)
end

local function tween(obj, props, t)
    TweenService:Create(obj, TweenInfo.new(t or 0.15, Enum.EasingStyle.Quad), props):Play()
end

local function corner(parent, r)
    Instance.new("UICorner", parent).CornerRadius = UDim.new(0, r or 10)
end

local function stroke(parent, color, thickness)
    local s = Instance.new("UIStroke", parent)
    s.Color = color or BORDER
    s.Thickness = thickness or 1
    s.ApplyStrokeMode = Enum.ApplyStrokeMode.Border
end

-- Visible UI
local gui = Instance.new("ScreenGui")
gui.Name = "AutoPressUI"
gui.ResetOnSpawn = false
gui.IgnoreGuiInset = true
gui.Parent = playerGui

local frame = Instance.new("Frame")
frame.Name = "Main"
frame.Size = UDim2.new(0, 300, 0, 420)
frame.Position = UDim2.new(0, 20, 0.5, -210)
frame.BackgroundColor3 = BG_MAIN
frame.BorderSizePixel = 0
frame.Active = true
frame.Draggable = true
frame.Parent = gui
corner(frame, 14)
stroke(frame, Color3.fromRGB(50, 50, 72), 1.5)

-- Gradient overlay via SVC
local grad = Instance.new("UIGradient")
grad.Color = ColorSequence.new({
    ColorSequenceKeypoint.new(0, Color3.fromRGB(28, 28, 28)),
    ColorSequenceKeypoint.new(1, BG_MAIN)
})
grad.Rotation = 90
grad.Parent = frame

-- Title bar
local titleBar = Instance.new("Frame")
titleBar.Size = UDim2.new(1, 0, 0, 48)
titleBar.BackgroundColor3 = BG_PANEL
titleBar.BorderSizePixel = 0
titleBar.Parent = frame
corner(titleBar, 14)

local titleFix = Instance.new("Frame")
titleFix.Size = UDim2.new(1, 0, 0.5, 0)
titleFix.Position = UDim2.new(0, 0, 0.5, 0)
titleFix.BackgroundColor3 = BG_PANEL
titleFix.BorderSizePixel = 0
titleFix.Parent = titleBar

local icon = Instance.new("TextLabel")
icon.Size = UDim2.new(0, 28, 0, 28)
icon.Position = UDim2.new(0, 12, 0.5, -14)
icon.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
icon.BorderSizePixel = 0
icon.Text = "โŒจ"
icon.TextColor3 = TEXT_ACCENT
icon.Font = Enum.Font.GothamBold
icon.TextSize = 14
icon.ZIndex = 2
icon.Parent = titleBar
corner(icon, 8)

local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1, -90, 1, 0)
titleLabel.Position = UDim2.new(0, 48, 0, 0)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "Auto-Press"
titleLabel.TextColor3 = TEXT_PRIMARY
titleLabel.Font = Enum.Font.GothamBold
titleLabel.TextSize = 15
titleLabel.TextXAlignment = Enum.TextXAlignment.Left
titleLabel.ZIndex = 2
titleLabel.Parent = titleBar

local subLabel = Instance.new("TextLabel")
subLabel.Size = UDim2.new(1, -90, 0, 14)
subLabel.Position = UDim2.new(0, 48, 0, 26)
subLabel.BackgroundTransparency = 1
subLabel.Text = "key automation"
subLabel.TextColor3 = TEXT_MUTED
subLabel.Font = Enum.Font.Gotham
subLabel.TextSize = 11
subLabel.TextXAlignment = Enum.TextXAlignment.Left
subLabel.ZIndex = 2
subLabel.Parent = titleBar

-- Status dot
local dotRing = Instance.new("Frame")
dotRing.Size = UDim2.new(0, 18, 0, 18)
dotRing.Position = UDim2.new(1, -56, 0.5, -9)
dotRing.BackgroundColor3 = Color3.fromRGB(28, 28, 28)
dotRing.BorderSizePixel = 0
dotRing.ZIndex = 2
dotRing.Parent = titleBar
corner(dotRing, 9)
stroke(dotRing, BORDER, 1)

local dot = Instance.new("Frame")
dot.Size = UDim2.new(0, 8, 0, 8)
dot.Position = UDim2.new(0.5, -4, 0.5, -4)
dot.BackgroundColor3 = TEXT_MUTED
dot.BorderSizePixel = 0
dot.ZIndex = 3
dot.Parent = dotRing
corner(dot, 4)

local minimized = false
local FULL_HEIGHT = 420
local MINI_HEIGHT = 48

local minBtn = Instance.new("TextButton")
minBtn.Size = UDim2.new(0, 24, 0, 24)
minBtn.Position = UDim2.new(1, -30, 0.5, -12)
minBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 35)
minBtn.BorderSizePixel = 0
minBtn.Text = "โ€”"
minBtn.TextColor3 = TEXT_MUTED
minBtn.Font = Enum.Font.GothamBold
minBtn.TextSize = 11
minBtn.ZIndex = 4
minBtn.Parent = titleBar
corner(minBtn, 6)
stroke(minBtn, BORDER, 1)

minBtn.MouseEnter:Connect(function()
    tween(minBtn, {BackgroundColor3 = Color3.fromRGB(50, 50, 72), TextColor3 = TEXT_PRIMARY})
end)
minBtn.MouseLeave:Connect(function()
    tween(minBtn, {BackgroundColor3 = Color3.fromRGB(35, 35, 52), TextColor3 = TEXT_MUTED})
end)

minBtn.MouseButton1Click:Connect(function()
    minimized = not minimized
    if minimized then
        tween(frame, {Size = UDim2.new(0, 300, 0, MINI_HEIGHT)}, 0.25)
        minBtn.Text = "+"
        frame.ClipsDescendants = true
    else
        frame.ClipsDescendants = false
        tween(frame, {Size = UDim2.new(0, 300, 0, FULL_HEIGHT)}, 0.25)
        minBtn.Text = "โ€”"
    end
end)

-- Toggle button
local toggleBtn = Instance.new("TextButton")
toggleBtn.Size = UDim2.new(1, -24, 0, 38)
toggleBtn.Position = UDim2.new(0, 12, 0, 58)
toggleBtn.BackgroundColor3 = BG_CARD
toggleBtn.BorderSizePixel = 0
toggleBtn.Text = "Enable ยท F6"
toggleBtn.TextColor3 = TEXT_MUTED
toggleBtn.Font = Enum.Font.GothamSemibold
toggleBtn.TextSize = 13
toggleBtn.ZIndex = 2
toggleBtn.Parent = frame
corner(toggleBtn, 9)
stroke(toggleBtn, BORDER, 1)

toggleBtn.MouseEnter:Connect(function()
    if not enabled then tween(toggleBtn, {BackgroundColor3 = Color3.fromRGB(32, 32, 46)}) end
end)
toggleBtn.MouseLeave:Connect(function()
    if not enabled then tween(toggleBtn, {BackgroundColor3 = BG_CARD}) end
end)

-- Divider
local function divider(y)
    local d = Instance.new("Frame")
    d.Size = UDim2.new(1, -24, 0, 1)
    d.Position = UDim2.new(0, 12, 0, y)
    d.BackgroundColor3 = BORDER
    d.BorderSizePixel = 0
    d.Parent = frame
end

-- Section label
local function sectionLabel(text, y)
    local l = Instance.new("TextLabel")
    l.Size = UDim2.new(1, -24, 0, 14)
    l.Position = UDim2.new(0, 12, 0, y)
    l.BackgroundTransparency = 1
    l.Text = text
    l.TextColor3 = TEXT_MUTED
    l.Font = Enum.Font.GothamSemibold
    l.TextSize = 10
    l.TextXAlignment = Enum.TextXAlignment.Left
    l.ZIndex = 2
    l.Parent = frame
end

divider(106)
sectionLabel("KEYS โ€” click to toggle", 114)

-- Key toggles
local keyOrder = {"V", "R", "Z", "X", "C"}
local keyBtns = {}

for i, k in ipairs(keyOrder) do
    local btn = Instance.new("TextButton")
    btn.Size = UDim2.new(0, 44, 0, 32)
    btn.Position = UDim2.new(0, 12 + (i-1) * 52, 0, 132)
    btn.BackgroundColor3 = keyEnabled[k] and ACCENT or BG_CARD
    btn.BorderSizePixel = 0
    btn.Text = k
    btn.TextColor3 = keyEnabled[k] and Color3.fromRGB(255,255,255) or TEXT_MUTED
    btn.Font = Enum.Font.GothamBold
    btn.TextSize = 13
    btn.ZIndex = 2
    btn.Parent = frame
    corner(btn, 8)
    if not keyEnabled[k] then stroke(btn, BORDER, 1) end
    keyBtns[k] = btn

    btn.MouseButton1Click:Connect(function()
        keyEnabled[k] = not keyEnabled[k]
        tween(btn, {
            BackgroundColor3 = keyEnabled[k] and ACCENT or BG_CARD,
            TextColor3 = keyEnabled[k] and Color3.fromRGB(255,255,255) or TEXT_MUTED
        })
    end)
end

divider(176)
sectionLabel("INTERVALS  (seconds)", 184)

-- Input rows
local function makeInput(labelText, y, default, minVal, onChange)
    local row = Instance.new("Frame")
    row.Size = UDim2.new(1, -24, 0, 34)
    row.Position = UDim2.new(0, 12, 0, y)
    row.BackgroundColor3 = BG_CARD
    row.BorderSizePixel = 0
    row.ZIndex = 2
    row.Parent = frame
    corner(row, 8)
    stroke(row, BORDER, 1)

    local lbl = Instance.new("TextLabel")
    lbl.Size = UDim2.new(0, 36, 1, 0)
    lbl.Position = UDim2.new(0, 12, 0, 0)
    lbl.BackgroundTransparency = 1
    lbl.Text = labelText
    lbl.TextColor3 = TEXT_PRIMARY
    lbl.Font = Enum.Font.GothamBold
    lbl.TextSize = 13
    lbl.TextXAlignment = Enum.TextXAlignment.Left
    lbl.ZIndex = 3
    lbl.Parent = row

    local hint = Instance.new("TextLabel")
    hint.Size = UDim2.new(1, -130, 1, 0)
    hint.Position = UDim2.new(0, 52, 0, 0)
    hint.BackgroundTransparency = 1
    hint.Text = "interval"
    hint.TextColor3 = TEXT_MUTED
    hint.Font = Enum.Font.Gotham
    hint.TextSize = 11
    hint.TextXAlignment = Enum.TextXAlignment.Left
    hint.ZIndex = 3
    hint.Parent = row

    local inputBg = Instance.new("Frame")
    inputBg.Size = UDim2.new(0, 80, 0, 24)
    inputBg.Position = UDim2.new(1, -88, 0.5, -12)
    inputBg.BackgroundColor3 = BG_INPUT
    inputBg.BorderSizePixel = 0
    inputBg.ZIndex = 3
    inputBg.Parent = row
    corner(inputBg, 6)
    stroke(inputBg, Color3.fromRGB(55, 55, 80), 1)

    local valBox = Instance.new("TextBox")
    valBox.Size = UDim2.new(1, 0, 1, 0)
    valBox.BackgroundTransparency = 1
    valBox.Text = string.format("%.2f", default)
    valBox.TextColor3 = TEXT_ACCENT
    valBox.Font = Enum.Font.GothamBold
    valBox.TextSize = 13
    valBox.TextXAlignment = Enum.TextXAlignment.Center
    valBox.ClearTextOnFocus = false
    valBox.ZIndex = 4
    valBox.Parent = inputBg

    local current = default

    valBox.Focused:Connect(function()
        tween(inputBg, {BackgroundColor3 = Color3.fromRGB(22, 22, 38)})
        stroke(inputBg, ACCENT, 1)
    end)

    valBox.FocusLost:Connect(function()
        tween(inputBg, {BackgroundColor3 = BG_INPUT})
        local num = tonumber(valBox.Text)
        if num and num >= minVal then
            current = math.floor(num * 100 + 0.5) / 100
            onChange(current)
        end
        valBox.Text = string.format("%.2f", current)
    end)
end

makeInput("V", 196, intervals.V, 0.05, function(v) intervals.V = v end)
makeInput("R", 238, intervals.R, 0.05, function(v) intervals.R = v end)
makeInput("Z", 280, intervals.Z, 0.05, function(v) intervals.Z = v end)
makeInput("X", 322, intervals.X, 0.05, function(v) intervals.X = v end)
makeInput("C", 364, intervals.C, 0.05, function(v) intervals.C = v end)

-- Toggle logic
local function setEnabled(val)
    enabled = val
    if val then
        tween(toggleBtn, {BackgroundColor3 = Color3.fromRGB(22, 80, 40)})
        toggleBtn.Text = "Disable ยท F6"
        toggleBtn.TextColor3 = ACCENT_ON
        tween(dot, {BackgroundColor3 = ACCENT_ON})
        tween(accentBar, {BackgroundColor3 = ACCENT_ON})
    else
        tween(toggleBtn, {BackgroundColor3 = BG_CARD})
        toggleBtn.Text = "Enable ยท F6"
        toggleBtn.TextColor3 = TEXT_MUTED
        tween(dot, {BackgroundColor3 = TEXT_MUTED})
        tween(accentBar, {BackgroundColor3 = ACCENT})
    end
end

toggleBtn.MouseButton1Click:Connect(function() setEnabled(not enabled) end)
UIS.InputBegan:Connect(function(input, gp)
    if input.KeyCode == Enum.KeyCode.F6 then setEnabled(not enabled) end
end)

-- Heartbeat
RunService.Heartbeat:Connect(function(dt)
    if not enabled then return end
    for _, k in ipairs(keyOrder) do
        if keyEnabled[k] then
            timers[k] += dt
            if timers[k] >= intervals[k] then
                timers[k] = 0
                pressKey(keyCodes[k])
            end
        end
    end
end)

Features & Information

All the script does is automatically press each button, with a bit more freedom about the delay and intervals.

Community Comments (1)

ZXCstariy_bogZXCstariy_bogJul 3, 2026

good

More Scripts for [2x๐Ÿ€]Broken Blade[Dragon]