跳转到内容
可用

Anti AFK Panel | Performance | AFK Offset

CLclarkdevlinorg0 次浏览Universal2026年7月26日
分享
Anti AFK Panel | Performance | AFK Offset

脚本代码

Lua
local Players = game:GetService("Players")
local LocalPlayer = Players.LocalPlayer
local CoreGui = game:GetService("CoreGui")
local VirtualUser = game:GetService("VirtualUser")
local RunService = game:GetService("RunService")

-- [UI Setup]: Prevent duplicate GUI screens from stacking
if CoreGui:FindFirstChild("UniversalUtilityGUI") then
    CoreGui:FindFirstChild("UniversalUtilityGUI"):Destroy()
end

-- [UI Setup]: Core Screen Container
local ScreenGui = Instance.new("ScreenGui")
ScreenGui.Name = "UniversalUtilityGUI"
ScreenGui.Parent = CoreGui
ScreenGui.ResetOnSpawn = false

-- [UI Setup]: Main Window Panel (Draggable Frame)
local MainFrame = Instance.new("Frame")
MainFrame.Name = "MainFrame"
MainFrame.Size = UDim2.new(0, 380, 0, 500)
MainFrame.Position = UDim2.new(0.5, -190, 0.5, -250)
MainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 28)
MainFrame.BorderSizePixel = 0
MainFrame.Active = true
MainFrame.Draggable = true
MainFrame.Parent = ScreenGui

local UICorner = Instance.new("UICorner")
UICorner.CornerRadius = UDim.new(0, 12)
UICorner.Parent = MainFrame

-- [UI Setup]: Header / Top Bar Decoration
local TopBar = Instance.new("Frame")
TopBar.Name = "TopBar"
TopBar.Size = UDim2.new(1, 0, 0, 45)
TopBar.BackgroundColor3 = Color3.fromRGB(30, 30, 40)
TopBar.BorderSizePixel = 0
TopBar.Parent = MainFrame

local TopCorner = Instance.new("UICorner")
TopCorner.CornerRadius = UDim.new(0, 12)
TopCorner.Parent = TopBar

local Title = Instance.new("TextLabel")
Title.Size = UDim2.new(1, -20, 1, 0)
Title.Position = UDim2.new(0, 15, 0, 0)
Title.Text = "Anti AFK Panel"
Title.TextColor3 = Color3.fromRGB(245, 245, 245)
Title.TextSize = 16
Title.Font = Enum.Font.GothamBold
Title.TextXAlignment = Enum.TextXAlignment.Left
Title.BackgroundTransparency = 1
Title.Parent = TopBar

-- [UI Setup]: Scrolling Layout Window
local ScrollFrame = Instance.new("ScrollingFrame")
ScrollFrame.Size = UDim2.new(1, -20, 1, -110)
ScrollFrame.Position = UDim2.new(0, 10, 0, 55)
ScrollFrame.BackgroundTransparency = 1
ScrollFrame.ScrollBarThickness = 4
ScrollFrame.ScrollBarImageColor3 = Color3.fromRGB(60, 60, 80)
ScrollFrame.CanvasSize = UDim2.new(0, 0, 0, 440)
ScrollFrame.ClipsDescendants = false
ScrollFrame.Parent = MainFrame

local UIListLayout = Instance.new("UIListLayout")
UIListLayout.Parent = ScrollFrame
UIListLayout.SortOrder = Enum.SortOrder.LayoutOrder
UIListLayout.Padding = UDim.new(0, 10)

-- [UI Creators]: Component Framework UI Generators
local function createStandardButton(name, text, layoutOrder)
    local btn = Instance.new("TextButton")
    btn.Name = name
    btn.Size = UDim2.new(1, -6, 0, 40)
    btn.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
    btn.Text = text
    btn.TextColor3 = Color3.fromRGB(255, 100, 100)
    btn.TextSize = 14
    btn.Font = Enum.Font.GothamSemibold
    btn.BorderSizePixel = 0
    btn.LayoutOrder = layoutOrder
    btn.Parent = ScrollFrame

    local corner = Instance.new("UICorner")
    corner.CornerRadius = UDim.new(0, 8)
    corner.Parent = btn
    return btn
end

local function createCheckbox(name, labelText, layoutOrder)
    local container = Instance.new("Frame")
    container.Name = name .. "_Container"
    container.Size = UDim2.new(1, -6, 0, 35)
    container.BackgroundTransparency = 1
    container.LayoutOrder = layoutOrder
    container.Parent = ScrollFrame

    local box = Instance.new("TextButton")
    box.Name = name
    box.Size = UDim2.new(0, 22, 0, 22)
    box.Position = UDim2.new(0, 5, 0.5, -11)
    box.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
    box.BorderSizePixel = 0
    box.Text = ""
    box.Parent = container

    local boxCorner = Instance.new("UICorner")
    boxCorner.CornerRadius = UDim.new(0, 4)
    boxCorner.Parent = box

    local label = Instance.new("TextLabel")
    label.Size = UDim2.new(1, -40, 1, 0)
    label.Position = UDim2.new(0, 35, 0, 0)
    label.BackgroundTransparency = 1
    label.Text = labelText
    label.TextColor3 = Color3.fromRGB(200, 200, 210)
    label.TextSize = 14
    label.Font = Enum.Font.GothamMedium
    label.TextXAlignment = Enum.TextXAlignment.Left
    label.Parent = container

    return box
end

-- [Elements]: Instantiate Main Interaction Elements
local FreezeButton = createStandardButton("FreezeButton", "Freeze Character: OFF", 1)

local YOffsetContainer = Instance.new("Frame")
YOffsetContainer.Name = "YOffsetContainer"
YOffsetContainer.Size = UDim2.new(1, -6, 0, 40)
YOffsetContainer.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
YOffsetContainer.LayoutOrder = 2
YOffsetContainer.Parent = ScrollFrame

local YOffsetCorner = Instance.new("UICorner")
YOffsetCorner.CornerRadius = UDim.new(0, 8)
YOffsetCorner.Parent = YOffsetContainer

local YStatusLabel = Instance.new("TextLabel")
YStatusLabel.Size = UDim2.new(0.6, 0, 1, 0)
YStatusLabel.Position = UDim2.new(0, 10, 0, 0)
YStatusLabel.BackgroundTransparency = 1
YStatusLabel.Text = "Current Y: Calculating..."
YStatusLabel.TextColor3 = Color3.fromRGB(200, 200, 210)
YStatusLabel.TextSize = 13
YStatusLabel.Font = Enum.Font.GothamMedium
YStatusLabel.TextXAlignment = Enum.TextXAlignment.Left
YStatusLabel.Parent = YOffsetContainer

local YTextBox = Instance.new("TextBox")
YTextBox.Size = UDim2.new(0.35, -5, 0, 28)
YTextBox.Position = UDim2.new(0.65, 0, 0.5, -14)
YTextBox.BackgroundColor3 = Color3.fromRGB(20, 20, 28)
YTextBox.Text = "Enter Offset"
YTextBox.PlaceholderText = "Offset..."
YTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
YTextBox.TextSize = 13
YTextBox.Font = Enum.Font.GothamSemibold
YTextBox.ClearTextOnFocus = true
YTextBox.Parent = YOffsetContainer

local TextCorner = Instance.new("UICorner")
TextCorner.CornerRadius = UDim.new(0, 6)
TextCorner.Parent = YTextBox

local DropdownContainer = Instance.new("Frame")
DropdownContainer.Name = "DropdownContainer"
DropdownContainer.Size = UDim2.new(1, -6, 0, 40)
DropdownContainer.BackgroundTransparency = 1
DropdownContainer.LayoutOrder = 3
DropdownContainer.ClipsDescendants = false
DropdownContainer.ZIndex = 20
DropdownContainer.Parent = ScrollFrame

local DropdownBtn = Instance.new("TextButton")
DropdownBtn.Size = UDim2.new(1, 0, 0, 40)
DropdownBtn.BackgroundColor3 = Color3.fromRGB(40, 40, 55)
DropdownBtn.Text = "Method: VirtualUser Click [v]"
DropdownBtn.TextColor3 = Color3.fromRGB(240, 240, 240)
DropdownBtn.TextSize = 14
DropdownBtn.Font = Enum.Font.GothamSemibold
DropdownBtn.ZIndex = 21
DropdownBtn.Parent = DropdownContainer

local DropdownCorner = Instance.new("UICorner")
DropdownCorner.CornerRadius = UDim.new(0, 8)
DropdownCorner.Parent = DropdownBtn

local DropdownList = Instance.new("Frame")
DropdownList.Size = UDim2.new(1, 0, 0, 80)
DropdownList.Position = UDim2.new(0, 0, 1, 4)
DropdownList.BackgroundColor3 = Color3.fromRGB(30, 30, 42)
DropdownList.BorderSizePixel = 0
DropdownList.Visible = false
DropdownList.ZIndex = 25
DropdownList.Parent = DropdownContainer

local ListCorner = Instance.new("UICorner")
ListCorner.CornerRadius = UDim.new(0, 8)
ListCorner.Parent = DropdownList

local function createDropdownOption(name, text, pos)
    local opt = Instance.new("TextButton")
    opt.Size = UDim2.new(1, 0, 0, 40)
    opt.Position = UDim2.new(0, 0, 0, pos)
    opt.BackgroundTransparency = 1
    opt.Text = text
    opt.TextColor3 = Color3.fromRGB(200, 200, 200)
    opt.TextSize = 13
    opt.Font = Enum.Font.Gotham
    opt.ZIndex = 26
    opt.Parent = DropdownList
    return opt
end

local OptMethod1 = createDropdownOption("Opt1", "VirtualUser Click (Standard)", 0)
local OptMethod2 = createDropdownOption("Opt2", "LocalPlayer Idled Bypass", 40)

local AntiAfkToggleBtn = createStandardButton("AntiAfkToggleBtn", "Anti-AFK: OFF", 4)

local RenderCheck   = createCheckbox("RenderCheck", "Disable 3D Rendering", 5)
local ChatCheck     = createCheckbox("ChatCheck", "Clear & Disable Chat", 6)
local HideUiCheck   = createCheckbox("HideUiCheck", "Hide Game UI (Keeps Panel)", 7)
local ParticleCheck = createCheckbox("ParticleCheck", "Disable All Particles", 8)

-- [Elements]: UI Closing / Destroy Button Area
local BottomArea = Instance.new("Frame")
BottomArea.Size = UDim2.new(1, -20, 0, 50)
BottomArea.Position = UDim2.new(0, 10, 1, -55)
BottomArea.BackgroundTransparency = 1
BottomArea.Parent = MainFrame

local DestroyButton = Instance.new("TextButton")
DestroyButton.Size = UDim2.new(1, 0, 0, 35)
DestroyButton.BackgroundColor3 = Color3.fromRGB(160, 40, 40)
DestroyButton.Text = "Destroy GUI"
DestroyButton.TextColor3 = Color3.fromRGB(255, 255, 255)
DestroyButton.TextSize = 14
DestroyButton.Font = Enum.Font.GothamBold
DestroyButton.Parent = BottomArea

local DestroyCorner = Instance.new("UICorner")
DestroyCorner.CornerRadius = UDim.new(0, 6)
DestroyCorner.Parent = DestroyButton

-- [Logic]: Internal Global States
local states = {
    antiAfk = false,
    afkMethod = "VirtualUser",
    frozen = false,
    yOffsetActive = false,
    renderingDisabled = false,
    chatCleared = false,
    uiHidden = false,
    particlesDisabled = false
}

local connections = {}

-- [Logic]: Visual Updates Manager for Checkboxes
local function updateCheckboxVisual(box, state)
    if state then
        box.BackgroundColor3 = Color3.fromRGB(100, 255, 100)
        box.Text = "X"
        box.TextColor3 = Color3.fromRGB(20, 20, 20)
        box.Font = Enum.Font.GothamBold
    else
        box.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        box.Text = ""
    end
end

-- [Logic]: Height Tracker Loop
connections.yTracker = RunService.Heartbeat:Connect(function()
    local character = LocalPlayer.Character
    if character then
        local rootPart = character:FindFirstChild("HumanoidRootPart") or character.PrimaryPart
        if rootPart then
            if not states.yOffsetActive then
                YStatusLabel.Text = "Current Y: " .. string.format("%.1f", rootPart.Position.Y)
            end
        end
    end
end)

-- [Logic]: Teleportation and Height Lock Logic
YTextBox.FocusLost:Connect(function(enterPressed)
    local num = tonumber(YTextBox.Text)
    local character = LocalPlayer.Character
    if not character then return end
    local rootPart = character:FindFirstChild("HumanoidRootPart") or character.PrimaryPart
    if not rootPart then return end

    if enterPressed and num then
        states.yOffsetActive = true
        YOffsetContainer.BackgroundColor3 = Color3.fromRGB(40, 60, 48)
        YTextBox.TextColor3 = Color3.fromRGB(100, 255, 100)
        
        rootPart.CFrame = CFrame.new(rootPart.Position.X, num, rootPart.Position.Z)
        task.wait(0.1)
        rootPart.Anchored = true
        
        states.frozen = true
        FreezeButton.Text = "Freeze Character: ON"
        FreezeButton.TextColor3 = Color3.fromRGB(100, 255, 100)
        FreezeButton.BackgroundColor3 = Color3.fromRGB(40, 60, 48)
        
        YStatusLabel.Text = "Frozen at Y: " .. tostring(num)
    elseif enterPressed and YTextBox.Text == "0" or YTextBox.Text == "" then
        states.yOffsetActive = false
        YOffsetContainer.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        YTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
        YTextBox.Text = "Enter Offset"
    end
end)

-- [Logic]: Dropdown Display Engine
DropdownBtn.MouseButton1Click:Connect(function()
    DropdownList.Visible = not DropdownList.Visible
    if DropdownList.Visible then
        DropdownBtn.Text = "Method: " .. (states.afkMethod == "VirtualUser" and "VirtualUser Click" or "Idled Bypass") .. " [^]"
    else
        DropdownBtn.Text = "Method: " .. (states.afkMethod == "VirtualUser" and "VirtualUser Click" or "Idled Bypass") .. " [v]"
    end
end)

local function selectMethod(methodType, displayName)
    states.afkMethod = methodType
    DropdownBtn.Text = "Method: " .. displayName .. " [v]"
    DropdownList.Visible = false
    
    if states.antiAfk then
        states.antiAfk = false
        AntiAfkToggleBtn.Text = "Anti-AFK: OFF"
        AntiAfkToggleBtn.TextColor3 = Color3.fromRGB(255, 100, 100)
        AntiAfkToggleBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        if connections.antiAfk then connections.antiAfk:Disconnect() end
    end
end

OptMethod1.MouseButton1Click:Connect(function() selectMethod("VirtualUser", "VirtualUser Click") end)
OptMethod2.MouseButton1Click:Connect(function() selectMethod("Bypass", "Idled Bypass") end)

-- [Logic]: Anti-AFK Engine Activation
AntiAfkToggleBtn.MouseButton1Click:Connect(function()
    states.antiAfk = not states.antiAfk
    if states.antiAfk then
        AntiAfkToggleBtn.Text = "Anti-AFK: ON"
        AntiAfkToggleBtn.TextColor3 = Color3.fromRGB(100, 255, 100)
        AntiAfkToggleBtn.BackgroundColor3 = Color3.fromRGB(40, 60, 48)
        
        if states.afkMethod == "VirtualUser" then
            connections.antiAfk = LocalPlayer.Idled:Connect(function()
                VirtualUser:CaptureController()
                VirtualUser:ClickButton2(Vector2.new(0, 0))
            end)
        elseif states.afkMethod == "Bypass" then
            connections.antiAfk = LocalPlayer.Idled:Connect(function()
                VirtualUser:Button2Down(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
                task.wait(0.2)
                VirtualUser:Button2Up(Vector2.new(0,0), workspace.CurrentCamera.CFrame)
            end)
        end
    else
        AntiAfkToggleBtn.Text = "Anti-AFK: OFF"
        AntiAfkToggleBtn.TextColor3 = Color3.fromRGB(255, 100, 100)
        AntiAfkToggleBtn.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        if connections.antiAfk then connections.antiAfk:Disconnect() end
    end
end)

-- [Logic]: Standard Physics Position Freeze
FreezeButton.MouseButton1Click:Connect(function()
    local character = LocalPlayer.Character
    if not character then return end
    local rootPart = character:FindFirstChild("HumanoidRootPart") or character.PrimaryPart
    if not rootPart then return end
    
    states.frozen = not states.frozen
    if states.frozen then
        FreezeButton.Text = "Freeze Character: ON"
        FreezeButton.TextColor3 = Color3.fromRGB(100, 255, 100)
        FreezeButton.BackgroundColor3 = Color3.fromRGB(40, 60, 48)
        rootPart.Anchored = true
    else
        FreezeButton.Text = "Freeze Character: OFF"
        FreezeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
        FreezeButton.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        rootPart.Anchored = false
        
        states.yOffsetActive = false
        YOffsetContainer.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
        YTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
        YTextBox.Text = "Enter Offset"
    end
end)

-- [Logic]: Engine GPU Performance Blocker (3D Rendering)
RenderCheck.MouseButton1Click:Connect(function()
    states.renderingDisabled = not states.renderingDisabled
    updateCheckboxVisual(RenderCheck, states.renderingDisabled)
    RunService:Set3dRenderingEnabled(not states.renderingDisabled)
end)

-- [Logic]: Chat Layout Interface Controller
ChatCheck.MouseButton1Click:Connect(function()
    states.chatCleared = not states.chatCleared
    updateCheckboxVisual(ChatCheck, states.chatCleared)
    pcall(function()
        game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, not states.chatCleared)
    end)
end)

-- [Logic]: Core Game UI Filter (Hide UI)
HideUiCheck.MouseButton1Click:Connect(function()
    states.uiHidden = not states.uiHidden
    updateCheckboxVisual(HideUiCheck, states.uiHidden)
    local coreGuiTypes = {
        Enum.CoreGuiType.PlayerList,
        Enum.CoreGuiType.Backpack,
        Enum.CoreGuiType.EmotesMenu
    }
    for _, guiType in ipairs(coreGuiTypes) do
        pcall(function()
            game:GetService("StarterGui"):SetCoreGuiEnabled(guiType, not states.uiHidden)
        end)
    end
end)

-- [Logic]: Particle Systems Optimizer Loop
connections.particles = workspace.DescendantAdded:Connect(function(descendant)
    if states.particlesDisabled and (descendant:IsA("ParticleEmitter") or descendant:IsA("Sparkles") or descendant:IsA("Smoke") or descendant:IsA("Fire")) then
        descendant.Enabled = false
    end
end)

ParticleCheck.MouseButton1Click:Connect(function()
    states.particlesDisabled = not states.particlesDisabled
    updateCheckboxVisual(ParticleCheck, states.particlesDisabled)
    if states.particlesDisabled then
        for _, obj in ipairs(workspace:GetDescendants()) do
            if obj:IsA("ParticleEmitter") or obj:IsA("Sparkles") or obj:IsA("Smoke") or obj:IsA("Fire") then
                obj.Enabled = false
            end
        end
    end
end)

-- [Logic]: Graceful Panel Reset and State Restore Function
local function cleanup()
    for _, connection in pairs(connections) do
        if connection then connection:Disconnect() end
    end
    
    pcall(function()
        RunService:Set3dRenderingEnabled(true)
        game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Chat, true)
        game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, true)
        game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true)
        game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.EmotesMenu, true)
        
        local character = LocalPlayer.Character
        if character then
            local rootPart = character:FindFirstChild("HumanoidRootPart") or character.PrimaryPart
            if rootPart then rootPart.Anchored = false end
        end
    end)
    
    ScreenGui:Destroy()
end

DestroyButton.MouseButton1Click:Connect(cleanup)

-- [Logic]: Auto-Reset handling for Respawning
LocalPlayer.CharacterAdded:Connect(function()
    states.frozen = false
    states.yOffsetActive = false
    FreezeButton.Text = "Freeze Character: OFF"
    FreezeButton.TextColor3 = Color3.fromRGB(255, 100, 100)
    FreezeButton.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
    YOffsetContainer.BackgroundColor3 = Color3.fromRGB(35, 35, 48)
    YTextBox.TextColor3 = Color3.fromRGB(255, 100, 100)
    YTextBox.Text = "Enter Offset"
end)

描述

Simple Anti-AFK user panel. - Everything is built into a simple GUI. **Use VirtualUser Click**, it works better.

评论 (0)

登录以参与讨论

  • 成为第一个评论的人。

常见问题

如何使用 Anti AFK Panel | Performance | AFK Offset 脚本?
复制上方的脚本代码,打开你的 Roblox 执行器,粘贴代码,然后在游戏中点击执行。脚本运行后功能会立即激活。
Anti AFK Panel | Performance | AFK Offset 脚本免费吗?
是的。此脚本免费复制和使用。如果使用密钥系统,请通过「获取密钥」链接免费解锁。
使用 Anti AFK Panel | Performance | AFK Offset 脚本安全吗?
完整源代码显示在此页面上,让你在运行前准确了解其功能。请始终使用可信的执行器,并记住使用脚本违反 Roblox 服务条款,风险自负。
哪个执行器兼容 Anti AFK Panel | Performance | AFK Offset?
此脚本兼容大多数热门 Roblox 执行器。查看我们的执行器页面,为你的设备找到可信的免费或付费执行器。
Anti AFK Panel | Performance | AFK Offset | BloxScripter