flick script made by ai 3
Key RequiredUniversal

flick script made by ai 3

Universal Scriptsmertni*qqsmertni*qq 729 views 127 executesUpdated Mar 18, 2026
Unrated
00
Lua Script•2036 lines (95281 chars)
local Library = loadstring(game:HttpGet("https://raw.githubusercontent.com/ImInsane-1337/neverlose-ui/refs/heads/main/source/library.lua"))()

-- [СЕРВИСЫ]
local UIS = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local Lighting = game:GetService("Lighting")
local TeleportService = game:GetService("TeleportService")
local HttpService = game:GetService("HttpService")
local Camera = workspace.CurrentCamera
local Player = Players.LocalPlayer

-- [ВСЕ НАСТРОЙКИ]
local QueueSave
local IsLoading = false
local SettingsData = {
    -- Aimbot
    Enabled = false, FOV = 150, HitPart = "Head", ShotDelay = 0.03,
    WallCheck = false, TeamCheck = false, Smoothing = false, SmoothFactor = 5,
    Prediction = false, PredictionAmount = 0.13, SilentAim = true,
    SilentExtraLead = 0.025,
    SilentForceShot = false,
    UseNamecallHook = false,
    AutoFire = false, TriggerBot = false, TriggerDelay = 0.05,
    
    -- Hitbox
    HitboxSink = false, HitboxSinkDepth = 15, HitboxDesync = false, HitboxDesyncOffset = 10,
    
    -- Target visuals
    TargetESP = false, TargetTracer = false, TargetPanel = true, TargetColor = Color3.fromRGB(255, 0, 0),
    ShowFOV = true, FOVColor = Color3.fromRGB(255, 255, 255),
    RaycastVisuals = false, RaycastMaxLines = 4, RaycastShowCount = true, RaycastColor = Color3.fromRGB(255, 120, 70),
    
    -- Player Visuals
    ChamsEnabled = false, GlowEnabled = false, RainbowGlow = false,
    ChamColor = Color3.fromRGB(255, 0, 0), GlowColor = Color3.fromRGB(255, 255, 255),
    ChamTransparency = 0.5,
    ChamType = "Fill", ChamWireThickness = 1.2, ChamWireLines = 240,
    
    -- ESP Drawing
    Boxes = false, BoxColor = Color3.fromRGB(255, 255, 255),
    CornerBoxes = false, CornerLength = 10,
    BoxFill = false, BoxFillColor = Color3.fromRGB(20, 20, 20), BoxFillTransparency = 0.7,
    Names = false, NameColor = Color3.fromRGB(255, 255, 255),
    Distance = false, DistanceColor = Color3.fromRGB(200, 200, 200),
    Tracers = false, TracerColor = Color3.fromRGB(255, 255, 255),
    HealthBar = false,
    
    -- Crosshair
    CrosshairEnabled = false, CrosshairColor = Color3.fromRGB(0, 255, 0),
    CrosshairSize = 10, CrosshairThickness = 1, CrosshairGap = 4,
    DotEnabled = false,
    
    -- World
    Fullbright = false, NoFog = false, CustomTime = false, TimeValue = 14,
    AmbientColor = Color3.fromRGB(178, 178, 178),
    -- Post FX
    BloomEnabled = false, BloomIntensity = 0.6, BloomSize = 24, BloomThreshold = 1,
    ColorCorrectionEnabled = false, ColorCorrectionContrast = 0.1, ColorCorrectionSaturation = 0.1,
    ColorCorrectionTint = Color3.fromRGB(255, 255, 255),
    
    -- FX
    RainbowParticles = false,
    TrailEnabled = false, TrailColor = Color3.fromRGB(0, 200, 255), TrailLifetime = 0.5,
    AuraEnabled = false, AuraColor = Color3.fromRGB(85, 170, 255),
    
    -- Movement
    SpeedEnabled = false, SpeedValue = 32,
    FlyEnabled = false, FlySpeed = 50,
    NoclipEnabled = false, InfJumpEnabled = false,
    JumpPower = false, JumpValue = 50,
    
    -- HUD
    HUDEnabled = true, HUDWatermark = true,
    HUDHealth = true, HUDSpeed = true, HUDCoords = true,
    HUDTarget = true, HUDPlayers = true, HUDFPS = true,
    HUDArraylist = true, HUDKeybinds = true,
    HUDColor = Color3.fromRGB(170, 85, 255),
    
    -- Misc
    AntiAFK = true, ClickTP = false, Notifications = true,
}

local Settings = setmetatable({}, {
    __index = SettingsData,
    __newindex = function(_, key, value)
        SettingsData[key] = value
        if not IsLoading and QueueSave then
            QueueSave()
        end
    end
})

-- [СОХРАНЕНИЕ ОРИГИНАЛЬНЫХ ЗНАЧЕНИЙ]
local OriginalLighting = {
    Brightness = Lighting.Brightness,
    ClockTime = Lighting.ClockTime,
    FogEnd = Lighting.FogEnd,
    FogStart = Lighting.FogStart,
    GlobalShadows = Lighting.GlobalShadows,
    Ambient = Lighting.Ambient,
    OutdoorAmbient = Lighting.OutdoorAmbient,
}

local function CopySettings(src)
    local dst = {}
    for k, v in pairs(src) do
        dst[k] = v
    end
    return dst
end

local DefaultSettings = CopySettings(SettingsData)

local Config = {
    Profile = "default",
    AutoSave = true,
    AutoLoad = true,
}

local CONFIG_DIR = "FlickSpeed"
local CONFIG_VERSION = 1
local pendingSave = false
local ConfigLoaded = false

local function SanitizeProfile(name)
    name = tostring(name or "")
    name = name:gsub("[^%w%-%_ ]", "")
    name = name:gsub("%s+", "_")
    return name
end

local function GetConfigPath()
    local profile = SanitizeProfile(Config.Profile)
    if profile == "" then
        profile = "default"
    end
    return CONFIG_DIR .. "/" .. profile .. ".json"
end

local function EncodeValue(v)
    if typeof(v) == "Color3" then
        return { __type = "Color3", r = v.R, g = v.G, b = v.B }
    end
    return v
end

local function DecodeValue(v)
    if type(v) == "table" and v.__type == "Color3" then
        return Color3.new(v.r or 0, v.g or 0, v.b or 0)
    end
    return v
end

local function TableHasValue(list, value)
    for _, v in ipairs(list) do
        if v == value then
            return true
        end
    end
    return false
end

local function SaveConfig()
    if not writefile then return false, "writefile unavailable" end
    if makefolder and not isfolder(CONFIG_DIR) then
        makefolder(CONFIG_DIR)
    end
    local data = { __version = CONFIG_VERSION }
    for k, v in pairs(SettingsData) do
        data[k] = EncodeValue(v)
    end
    local ok, json = pcall(function()
        return HttpService:JSONEncode(data)
    end)
    if not ok then return false, "encode failed" end
    local ok2, err = pcall(function()
        writefile(GetConfigPath(), json)
    end)
    if not ok2 then return false, err end
    return true
end

local function LoadConfig()
    if not readfile or not isfile then return false, "readfile unavailable" end
    local path = GetConfigPath()
    if not isfile(path) then return false, "missing" end
    local ok, data = pcall(function()
        return HttpService:JSONDecode(readfile(path))
    end)
    if not ok or type(data) ~= "table" then return false, "decode failed" end
    IsLoading = true
    for k, v in pairs(data) do
        if k ~= "__version" and k ~= "UseNamecallHook" and SettingsData[k] ~= nil then
            SettingsData[k] = DecodeValue(v)
        end
    end
    SettingsData.UseNamecallHook = false
    if not TableHasValue({"Head", "HumanoidRootPart", "UpperTorso", "LowerTorso"}, SettingsData.HitPart) then
        SettingsData.HitPart = "Head"
    end
    if not TableHasValue({"Fill", "Outline", "Flat", "Wireframe", "Fill+Wireframe", "TriFill", "TriMesh"}, SettingsData.ChamType) then
        SettingsData.ChamType = "Fill"
    end
    SettingsData.ChamWireLines = math.clamp(tonumber(SettingsData.ChamWireLines) or 240, 24, 600)
    SettingsData.ChamWireThickness = math.clamp(tonumber(SettingsData.ChamWireThickness) or 1.2, 0.5, 5)
    IsLoading = false
    ConfigLoaded = true
    return true
end

local function ResetSettings()
    IsLoading = true
    for k, v in pairs(DefaultSettings) do
        SettingsData[k] = v
    end
    IsLoading = false
end

QueueSave = function()
    if IsLoading or not Config.AutoSave then return end
    if pendingSave then return end
    pendingSave = true
    task.delay(0.6, function()
        pendingSave = false
        if not IsLoading and Config.AutoSave then
            SaveConfig()
        end
    end)
end

local UIControls = {}
local function RegisterControl(key, control)
    if key and control then
        UIControls[key] = control
    end
    return control
end

local function SafeSet(control, value)
    if not control then return end
    local ok = pcall(function() control:Set(value) end)
    if ok then return end
    ok = pcall(function() control:SetValue(value) end)
    if ok then return end
    pcall(function() control:SetColor(value) end)
end

local function SyncUI()
    IsLoading = true
    for key, control in pairs(UIControls) do
        if SettingsData[key] ~= nil then
            SafeSet(control, SettingsData[key])
        end
    end
    IsLoading = false
end

if Config.AutoLoad then
    pcall(function()
        LoadConfig()
    end)
end

local BloomEffect = Lighting:FindFirstChild("FlickBloom")
local ColorCorrectionEffect = Lighting:FindFirstChild("FlickColorCorrection")

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  UI WINDOW
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local Window = Library:Window({
    Name = "FlickSpeed",
    SubName = "Private | v3.0",
    Logo = "120959262762131"
})

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  PAGE 1: COMBAT
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local CombatPage = Window:Page({Name = "Combat"})

-- Silent Aim
local AimSec = CombatPage:Section({Name = "Silent Aim"})
RegisterControl("Enabled", AimSec:Toggle({Name = "Enable", Default = Settings.Enabled, Callback = function(v) Settings.Enabled = v end}))
RegisterControl("SilentAim", AimSec:Toggle({Name = "Silent Aim Mode", Default = Settings.SilentAim, Callback = function(v) Settings.SilentAim = v end}))
AimSec:Label("Namecall hook disabled (anti-detect)")
RegisterControl("WallCheck", AimSec:Toggle({Name = "Wall Check", Default = Settings.WallCheck, Callback = function(v) Settings.WallCheck = v end}))
RegisterControl("TeamCheck", AimSec:Toggle({Name = "Team Check", Default = Settings.TeamCheck, Callback = function(v) Settings.TeamCheck = v end}))
RegisterControl("FOV", AimSec:Slider({Name = "FOV Radius", Min = 30, Max = 1000, Default = Settings.FOV, Callback = function(v) Settings.FOV = v end}))
RegisterControl("HitPart", AimSec:Dropdown({Name = "Hit Part", Default = Settings.HitPart, Items = {"Head", "HumanoidRootPart", "UpperTorso", "LowerTorso"}, Callback = function(v) Settings.HitPart = v end}))
RegisterControl("ShotDelay", AimSec:Slider({Name = "Shot Delay", Min = 0, Max = 0.2, Default = Settings.ShotDelay, Decimals = 0.01, Callback = function(v) Settings.ShotDelay = v end}))
RegisterControl("SilentExtraLead", AimSec:Slider({Name = "Silent Extra Lead", Min = 0, Max = 0.2, Default = Settings.SilentExtraLead, Decimals = 0.005, Callback = function(v) Settings.SilentExtraLead = v end}))
RegisterControl("SilentForceShot", AimSec:Toggle({Name = "Silent Force Shot", Default = Settings.SilentForceShot, Callback = function(v) Settings.SilentForceShot = v end}))

-- Hitbox Manipulation
local HitboxSec = CombatPage:Section({Name = "Hitbox Sink (Anti-Aim)"})
RegisterControl("HitboxSink", HitboxSec:Toggle({Name = "Hitbox Sink", Default = Settings.HitboxSink, Callback = function(v) Settings.HitboxSink = v
    if not v then
        pcall(function()
            local char = Player.Character
            if char then
                for _, part in pairs(char:GetDescendants()) do
                    if part:IsA("BasePart") and part.Name ~= "HumanoidRootPart" then
                        part.LocalTransparencyModifier = 0
                    end
                end
            end
        end)
    end
end}))
RegisterControl("HitboxSinkDepth", HitboxSec:Slider({Name = "Sink Depth (studs)", Min = 5, Max = 50, Default = Settings.HitboxSinkDepth, Callback = function(v) Settings.HitboxSinkDepth = v end}))
RegisterControl("HitboxDesync", HitboxSec:Toggle({Name = "Hitbox Desync (Jitter)", Default = Settings.HitboxDesync, Callback = function(v) Settings.HitboxDesync = v end}))
RegisterControl("HitboxDesyncOffset", HitboxSec:Slider({Name = "Desync Offset", Min = 3, Max = 30, Default = Settings.HitboxDesyncOffset, Callback = function(v) Settings.HitboxDesyncOffset = v end}))

-- Smoothing
local SmoothSec = CombatPage:Section({Name = "Aim Assist (Legit)"})
RegisterControl("Smoothing", SmoothSec:Toggle({Name = "Smoothing", Default = Settings.Smoothing, Callback = function(v) Settings.Smoothing = v end}))
RegisterControl("SmoothFactor", SmoothSec:Slider({Name = "Smooth Factor", Min = 1, Max = 20, Default = Settings.SmoothFactor, Callback = function(v) Settings.SmoothFactor = v end}))
RegisterControl("Prediction", SmoothSec:Toggle({Name = "Prediction", Default = Settings.Prediction, Callback = function(v) Settings.Prediction = v end}))
RegisterControl("PredictionAmount", SmoothSec:Slider({Name = "Prediction Amount", Min = 0.05, Max = 0.5, Default = Settings.PredictionAmount, Decimals = 0.01, Callback = function(v) Settings.PredictionAmount = v end}))

-- Triggerbot
local TriggerSec = CombatPage:Section({Name = "Triggerbot"})
RegisterControl("AutoFire", TriggerSec:Toggle({Name = "Auto Fire", Default = Settings.AutoFire, Callback = function(v) Settings.AutoFire = v end}))
RegisterControl("TriggerBot", TriggerSec:Toggle({Name = "Triggerbot", Default = Settings.TriggerBot, Callback = function(v) Settings.TriggerBot = v end}))
RegisterControl("TriggerDelay", TriggerSec:Slider({Name = "Trigger Delay", Min = 0, Max = 0.3, Default = Settings.TriggerDelay, Decimals = 0.01, Callback = function(v) Settings.TriggerDelay = v end}))

-- Target Visuals
local TargetVisSec = CombatPage:Section({Name = "Target Visuals"})
RegisterControl("ShowFOV", TargetVisSec:Toggle({Name = "Show FOV Circle", Default = Settings.ShowFOV, Callback = function(v) Settings.ShowFOV = v end}))
RegisterControl("FOVColor", TargetVisSec:Label("FOV Color"):Colorpicker({Default = Settings.FOVColor, Callback = function(v) Settings.FOVColor = v end}))
RegisterControl("TargetESP", TargetVisSec:Toggle({Name = "Target ESP (Circle)", Default = Settings.TargetESP, Callback = function(v) Settings.TargetESP = v end}))
RegisterControl("TargetTracer", TargetVisSec:Toggle({Name = "Target Tracer", Default = Settings.TargetTracer, Callback = function(v) Settings.TargetTracer = v end}))
RegisterControl("TargetPanel", TargetVisSec:Toggle({Name = "Target Panel", Default = Settings.TargetPanel, Callback = function(v) Settings.TargetPanel = v end}))
RegisterControl("TargetColor", TargetVisSec:Label("Target Color"):Colorpicker({Default = Settings.TargetColor, Callback = function(v) Settings.TargetColor = v end}))
RegisterControl("RaycastVisuals", TargetVisSec:Toggle({Name = "Raycast Visuals", Default = Settings.RaycastVisuals, Callback = function(v) Settings.RaycastVisuals = v end}))
RegisterControl("RaycastMaxLines", TargetVisSec:Slider({Name = "Raycast Max Lines", Min = 1, Max = 12, Default = Settings.RaycastMaxLines, Callback = function(v) Settings.RaycastMaxLines = v end}))
RegisterControl("RaycastShowCount", TargetVisSec:Toggle({Name = "Show Raycast Count", Default = Settings.RaycastShowCount, Callback = function(v) Settings.RaycastShowCount = v end}))
RegisterControl("RaycastColor", TargetVisSec:Label("Raycast Color"):Colorpicker({Default = Settings.RaycastColor, Callback = function(v) Settings.RaycastColor = v end}))

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  PAGE 2: VISUALS
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local VisualPage = Window:Page({Name = "Visuals"})

local PlayerSec = VisualPage:Section({Name = "Player Chams"})
RegisterControl("ChamsEnabled", PlayerSec:Toggle({Name = "Chams", Default = Settings.ChamsEnabled, Callback = function(v) Settings.ChamsEnabled = v end}))
RegisterControl("ChamType", PlayerSec:Dropdown({Name = "Chams Type", Default = Settings.ChamType, Items = {"Fill", "Outline", "Flat", "Wireframe", "Fill+Wireframe", "TriFill", "TriMesh"}, Callback = function(v) Settings.ChamType = v end}))
RegisterControl("ChamTransparency", PlayerSec:Slider({Name = "Fill Transparency", Min = 0, Max = 1, Default = Settings.ChamTransparency, Decimals = 0.1, Callback = function(v) Settings.ChamTransparency = v end}))
RegisterControl("ChamWireThickness", PlayerSec:Slider({Name = "Wire Thickness", Min = 0.5, Max = 5, Default = Settings.ChamWireThickness, Decimals = 0.1, Callback = function(v) Settings.ChamWireThickness = v end}))
RegisterControl("ChamWireLines", PlayerSec:Slider({Name = "Wireframe Lines", Min = 24, Max = 600, Default = Settings.ChamWireLines, Decimals = 12, Callback = function(v) Settings.ChamWireLines = v end}))
RegisterControl("ChamColor", PlayerSec:Label("Chams Color"):Colorpicker({Default = Settings.ChamColor, Callback = function(v) Settings.ChamColor = v end}))
RegisterControl("GlowEnabled", PlayerSec:Toggle({Name = "Glow (Outline)", Default = Settings.GlowEnabled, Callback = function(v) Settings.GlowEnabled = v end}))
RegisterControl("RainbowGlow", PlayerSec:Toggle({Name = "Rainbow Glow", Default = Settings.RainbowGlow, Callback = function(v) Settings.RainbowGlow = v end}))
RegisterControl("GlowColor", PlayerSec:Label("Glow Color"):Colorpicker({Default = Settings.GlowColor, Callback = function(v) Settings.GlowColor = v end}))

local ESPSec = VisualPage:Section({Name = "ESP (Drawing)"})
RegisterControl("Boxes", ESPSec:Toggle({Name = "Boxes", Default = Settings.Boxes, Callback = function(v) Settings.Boxes = v end}))
RegisterControl("CornerBoxes", ESPSec:Toggle({Name = "Corner Boxes", Default = Settings.CornerBoxes, Callback = function(v) Settings.CornerBoxes = v end}))
RegisterControl("CornerLength", ESPSec:Slider({Name = "Corner Length", Min = 4, Max = 30, Default = Settings.CornerLength, Callback = function(v) Settings.CornerLength = v end}))
RegisterControl("BoxColor", ESPSec:Label("Box Color"):Colorpicker({Default = Settings.BoxColor, Callback = function(v) Settings.BoxColor = v end}))
RegisterControl("BoxFill", ESPSec:Toggle({Name = "Box Fill", Default = Settings.BoxFill, Callback = function(v) Settings.BoxFill = v end}))
RegisterControl("BoxFillTransparency", ESPSec:Slider({Name = "Fill Transparency", Min = 0, Max = 1, Default = Settings.BoxFillTransparency, Decimals = 0.05, Callback = function(v) Settings.BoxFillTransparency = v end}))
RegisterControl("BoxFillColor", ESPSec:Label("Fill Color"):Colorpicker({Default = Settings.BoxFillColor, Callback = function(v) Settings.BoxFillColor = v end}))
RegisterControl("Names", ESPSec:Toggle({Name = "Names", Default = Settings.Names, Callback = function(v) Settings.Names = v end}))
RegisterControl("NameColor", ESPSec:Label("Name Color"):Colorpicker({Default = Settings.NameColor, Callback = function(v) Settings.NameColor = v end}))
RegisterControl("Distance", ESPSec:Toggle({Name = "Distance", Default = Settings.Distance, Callback = function(v) Settings.Distance = v end}))
RegisterControl("DistanceColor", ESPSec:Label("Distance Color"):Colorpicker({Default = Settings.DistanceColor, Callback = function(v) Settings.DistanceColor = v end}))
RegisterControl("Tracers", ESPSec:Toggle({Name = "Tracers", Default = Settings.Tracers, Callback = function(v) Settings.Tracers = v end}))
RegisterControl("TracerColor", ESPSec:Label("Tracer Color"):Colorpicker({Default = Settings.TracerColor, Callback = function(v) Settings.TracerColor = v end}))
RegisterControl("HealthBar", ESPSec:Toggle({Name = "Health Bar", Default = Settings.HealthBar, Callback = function(v) Settings.HealthBar = v end}))

-- Crosshair
local CrossSec = VisualPage:Section({Name = "Crosshair"})
RegisterControl("CrosshairEnabled", CrossSec:Toggle({Name = "Custom Crosshair", Default = Settings.CrosshairEnabled, Callback = function(v) Settings.CrosshairEnabled = v end}))
RegisterControl("DotEnabled", CrossSec:Toggle({Name = "Center Dot", Default = Settings.DotEnabled, Callback = function(v) Settings.DotEnabled = v end}))
RegisterControl("CrosshairColor", CrossSec:Label("Crosshair Color"):Colorpicker({Default = Settings.CrosshairColor, Callback = function(v) Settings.CrosshairColor = v end}))
RegisterControl("CrosshairSize", CrossSec:Slider({Name = "Size", Min = 4, Max = 30, Default = Settings.CrosshairSize, Callback = function(v) Settings.CrosshairSize = v end}))
RegisterControl("CrosshairGap", CrossSec:Slider({Name = "Gap", Min = 0, Max = 15, Default = Settings.CrosshairGap, Callback = function(v) Settings.CrosshairGap = v end}))
RegisterControl("CrosshairThickness", CrossSec:Slider({Name = "Thickness", Min = 1, Max = 4, Default = Settings.CrosshairThickness, Callback = function(v) Settings.CrosshairThickness = v end}))

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  PAGE 3: WORLD
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local WorldPage = Window:Page({Name = "World"})

local LightSec = WorldPage:Section({Name = "Lighting"})
RegisterControl("Fullbright", LightSec:Toggle({Name = "Fullbright", Default = Settings.Fullbright, Callback = function(v)
    Settings.Fullbright = v
    if not v then
        Lighting.Brightness = OriginalLighting.Brightness
        Lighting.ClockTime = OriginalLighting.ClockTime
        Lighting.GlobalShadows = OriginalLighting.GlobalShadows
        Lighting.Ambient = OriginalLighting.Ambient
    end
end}))
RegisterControl("NoFog", LightSec:Toggle({Name = "No Fog", Default = Settings.NoFog, Callback = function(v)
    Settings.NoFog = v
    if not v then
        Lighting.FogEnd = OriginalLighting.FogEnd
        Lighting.FogStart = OriginalLighting.FogStart
    end
end}))
RegisterControl("CustomTime", LightSec:Toggle({Name = "Custom Time", Default = Settings.CustomTime, Callback = function(v) Settings.CustomTime = v if not v then Lighting.ClockTime = OriginalLighting.ClockTime end end}))
RegisterControl("TimeValue", LightSec:Slider({Name = "Time of Day", Min = 0, Max = 24, Default = Settings.TimeValue, Decimals = 0.5, Callback = function(v) Settings.TimeValue = v end}))
RegisterControl("AmbientColor", LightSec:Label("Ambient Color"):Colorpicker({Default = Settings.AmbientColor, Callback = function(v) Settings.AmbientColor = v end}))

local FXSec = WorldPage:Section({Name = "Post Processing"})
RegisterControl("BloomEnabled", FXSec:Toggle({Name = "Bloom", Default = Settings.BloomEnabled, Callback = function(v) Settings.BloomEnabled = v end}))
RegisterControl("BloomIntensity", FXSec:Slider({Name = "Bloom Intensity", Min = 0, Max = 3, Default = Settings.BloomIntensity, Decimals = 0.1, Callback = function(v) Settings.BloomIntensity = v end}))
RegisterControl("BloomSize", FXSec:Slider({Name = "Bloom Size", Min = 0, Max = 56, Default = Settings.BloomSize, Callback = function(v) Settings.BloomSize = v end}))
RegisterControl("BloomThreshold", FXSec:Slider({Name = "Bloom Threshold", Min = 0, Max = 2, Default = Settings.BloomThreshold, Decimals = 0.05, Callback = function(v) Settings.BloomThreshold = v end}))
RegisterControl("ColorCorrectionEnabled", FXSec:Toggle({Name = "Color Correction", Default = Settings.ColorCorrectionEnabled, Callback = function(v) Settings.ColorCorrectionEnabled = v end}))
RegisterControl("ColorCorrectionContrast", FXSec:Slider({Name = "Contrast", Min = -1, Max = 1, Default = Settings.ColorCorrectionContrast, Decimals = 0.05, Callback = function(v) Settings.ColorCorrectionContrast = v end}))
RegisterControl("ColorCorrectionSaturation", FXSec:Slider({Name = "Saturation", Min = -1, Max = 1, Default = Settings.ColorCorrectionSaturation, Decimals = 0.05, Callback = function(v) Settings.ColorCorrectionSaturation = v end}))
RegisterControl("ColorCorrectionTint", FXSec:Label("Tint Color"):Colorpicker({Default = Settings.ColorCorrectionTint, Callback = function(v) Settings.ColorCorrectionTint = v end}))

-- в”Ђв”Ђ CHARACTER FX в”Ђв”Ђ
local FXCharSec = WorldPage:Section({Name = "Character FX"})
RegisterControl("RainbowParticles", FXCharSec:Toggle({Name = "Rainbow FX", Default = Settings.RainbowParticles, Callback = function(v) Settings.RainbowParticles = v end}))
RegisterControl("TrailEnabled", FXCharSec:Toggle({Name = "Character Trail", Default = Settings.TrailEnabled, Callback = function(v) Settings.TrailEnabled = v
    if not v then pcall(function() for _,obj in pairs(Player.Character:GetDescendants()) do if obj.Name == "FlickTrail" or obj.Name == "FlickTrailA" or obj.Name == "FlickTrailB" then obj:Destroy() end end end) end
end}))
RegisterControl("TrailLifetime", FXCharSec:Slider({Name = "Trail Lifetime", Min = 0.1, Max = 3, Default = Settings.TrailLifetime, Decimals = 0.1, Callback = function(v) Settings.TrailLifetime = v end}))
RegisterControl("TrailColor", FXCharSec:Label("Trail Color"):Colorpicker({Default = Settings.TrailColor, Callback = function(v) Settings.TrailColor = v end}))

RegisterControl("AuraEnabled", FXCharSec:Toggle({Name = "Aura Effect", Default = Settings.AuraEnabled, Callback = function(v) Settings.AuraEnabled = v
    if not v then pcall(function() for _,obj in pairs(Player.Character:GetDescendants()) do if obj.Name == "FlickAura" then obj:Destroy() end end end) end
end}))
RegisterControl("AuraColor", FXCharSec:Label("Aura Color"):Colorpicker({Default = Settings.AuraColor, Callback = function(v) Settings.AuraColor = v end}))

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  PAGE 4: MOVEMENT
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local MovePage = Window:Page({Name = "Movement"})

local SpeedSec = MovePage:Section({Name = "Speed"})
RegisterControl("SpeedEnabled", SpeedSec:Toggle({Name = "Speed Hack", Default = Settings.SpeedEnabled, Callback = function(v) Settings.SpeedEnabled = v
    if not v then pcall(function() local h = Player.Character and Player.Character:FindFirstChildOfClass("Humanoid") if h then h.WalkSpeed = 16 end end) end
end}))
RegisterControl("SpeedValue", SpeedSec:Slider({Name = "Walk Speed", Min = 16, Max = 200, Default = Settings.SpeedValue, Callback = function(v) Settings.SpeedValue = v end}))

local JumpSec = MovePage:Section({Name = "Jump"})
RegisterControl("JumpPower", JumpSec:Toggle({Name = "Custom Jump Power", Default = Settings.JumpPower, Callback = function(v) Settings.JumpPower = v
    if not v then pcall(function() local h = Player.Character and Player.Character:FindFirstChildOfClass("Humanoid") if h then h.JumpPower = 50 end end) end
end}))
RegisterControl("JumpValue", JumpSec:Slider({Name = "Jump Power", Min = 50, Max = 300, Default = Settings.JumpValue, Callback = function(v) Settings.JumpValue = v end}))
RegisterControl("InfJumpEnabled", JumpSec:Toggle({Name = "Infinite Jump", Default = Settings.InfJumpEnabled, Callback = function(v) Settings.InfJumpEnabled = v end}))

local FlySec = MovePage:Section({Name = "Fly & Noclip"})
RegisterControl("FlyEnabled", FlySec:Toggle({Name = "Fly (Space + WASD)", Default = Settings.FlyEnabled, Callback = function(v) Settings.FlyEnabled = v
    if not v then pcall(function() local hrp = Player.Character:FindFirstChild("HumanoidRootPart")
        for _, obj in pairs(hrp:GetChildren()) do if obj.Name == "FlickBP" or obj.Name == "FlickBG" then obj:Destroy() end end
    end) end
end}))
RegisterControl("FlySpeed", FlySec:Slider({Name = "Fly Speed", Min = 10, Max = 200, Default = Settings.FlySpeed, Callback = function(v) Settings.FlySpeed = v end}))
RegisterControl("NoclipEnabled", FlySec:Toggle({Name = "Noclip", Default = Settings.NoclipEnabled, Callback = function(v)
    Settings.NoclipEnabled = v
    if not v then
        pcall(function()
            local char = Player.Character
            if char then
                for _, p in pairs(char:GetDescendants()) do
                    if p:IsA("BasePart") then p.CanCollide = true end
                end
            end
        end)
    end
end}))

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  PAGE 5: MISC
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local MiscPage = Window:Page({Name = "Misc"})

local UtilSec = MiscPage:Section({Name = "Utility"})
RegisterControl("AntiAFK", UtilSec:Toggle({Name = "Anti-AFK", Default = Settings.AntiAFK, Callback = function(v) Settings.AntiAFK = v end}))
RegisterControl("ClickTP", UtilSec:Toggle({Name = "Click TP (Ctrl+Click)", Default = Settings.ClickTP, Callback = function(v) Settings.ClickTP = v end}))
UtilSec:Button({Name = "Rejoin Server", Callback = function() pcall(function() TeleportService:Teleport(game.PlaceId, Player) end) end})
UtilSec:Button({Name = "Server Hop", Callback = function()
    pcall(function()
        local HttpService = game:GetService("HttpService")
        local data = HttpService:JSONDecode(game:HttpGet("https://games.roblox.com/v1/games/"..game.PlaceId.."/servers/Public?sortOrder=Asc&limit=100"))
        for _, s in pairs(data.data) do
            if s.id ~= game.JobId then TeleportService:TeleportToPlaceInstance(game.PlaceId, s.id, Player) break end
        end
    end)
end})
UtilSec:Button({Name = "Copy Place ID", Callback = function() pcall(function() setclipboard(tostring(game.PlaceId)) end) end})
UtilSec:Button({Name = "Reset Character", Callback = function() pcall(function() Player.Character:FindFirstChildOfClass("Humanoid").Health = 0 end) end})

-- в”Ђв”Ђ HUD в”Ђв”Ђ
local HUDSec = MiscPage:Section({Name = "HUD (On-Screen)"})
RegisterControl("HUDEnabled", HUDSec:Toggle({Name = "Enable HUD", Default = Settings.HUDEnabled, Callback = function(v) Settings.HUDEnabled = v end}))
RegisterControl("HUDWatermark", HUDSec:Toggle({Name = "Watermark", Default = Settings.HUDWatermark, Callback = function(v) Settings.HUDWatermark = v end}))
RegisterControl("HUDFPS", HUDSec:Toggle({Name = "FPS Counter", Default = Settings.HUDFPS, Callback = function(v) Settings.HUDFPS = v end}))
RegisterControl("HUDHealth", HUDSec:Toggle({Name = "Health Bar", Default = Settings.HUDHealth, Callback = function(v) Settings.HUDHealth = v end}))
RegisterControl("HUDSpeed", HUDSec:Toggle({Name = "Speed Display", Default = Settings.HUDSpeed, Callback = function(v) Settings.HUDSpeed = v end}))
RegisterControl("HUDCoords", HUDSec:Toggle({Name = "Coordinates", Default = Settings.HUDCoords, Callback = function(v) Settings.HUDCoords = v end}))
RegisterControl("HUDTarget", HUDSec:Toggle({Name = "Target Info", Default = Settings.HUDTarget, Callback = function(v) Settings.HUDTarget = v end}))
RegisterControl("HUDPlayers", HUDSec:Toggle({Name = "Player Count", Default = Settings.HUDPlayers, Callback = function(v) Settings.HUDPlayers = v end}))
RegisterControl("HUDArraylist", HUDSec:Toggle({Name = "Modules List", Default = Settings.HUDArraylist, Callback = function(v) Settings.HUDArraylist = v end}))
RegisterControl("HUDKeybinds", HUDSec:Toggle({Name = "Keybinds Panel", Default = Settings.HUDKeybinds, Callback = function(v) Settings.HUDKeybinds = v end}))
RegisterControl("HUDColor", HUDSec:Label("HUD Accent Color"):Colorpicker({Default = Settings.HUDColor, Callback = function(v) Settings.HUDColor = v end}))

local InfoSec = MiscPage:Section({Name = "Info"})
InfoSec:Label("Player: " .. Player.DisplayName .. " (@" .. Player.Name .. ")")
InfoSec:Label("UserID: " .. Player.UserId)
InfoSec:Label("PlaceID: " .. game.PlaceId)
InfoSec:Label("Executor: Velocity 0.8.0")
InfoSec:Label("Script: FlickSpeed v3.5")

local ConfigPage = Window:Page({Name = "Config"})
local ConfigSec = ConfigPage:Section({Name = "Profiles"})
ConfigSec:Textbox({Name = "Profile Name", Default = Config.Profile, Placeholder = "default", Finished = true, Callback = function(v)
    Config.Profile = SanitizeProfile(v)
end})
ConfigSec:Toggle({Name = "Auto Load", Default = Config.AutoLoad, Callback = function(v) Config.AutoLoad = v end})
ConfigSec:Toggle({Name = "Auto Save", Default = Config.AutoSave, Callback = function(v) Config.AutoSave = v end})
ConfigSec:Button({Name = "Load", Callback = function()
    if LoadConfig() then
        SyncUI()
    end
end})
ConfigSec:Button({Name = "Save", Callback = function() SaveConfig() end})
ConfigSec:Button({Name = "Reset Defaults", Callback = function()
    ResetSettings()
    SyncUI()
end})
ConfigSec:Label("Config folder: " .. CONFIG_DIR)

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  DRAWING OBJECTS
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
local FOVCircle = Drawing.new("Circle")
FOVCircle.Thickness = 1; FOVCircle.Filled = false; FOVCircle.NumSides = 64

local TargetLine = Drawing.new("Line")
TargetLine.Thickness = 1.5

local TargetCircle = Drawing.new("Circle")
TargetCircle.Thickness = 1.5; TargetCircle.Filled = false; TargetCircle.Radius = 15

-- Target panel (like combat HUD)
local TargetPanelBG = Drawing.new("Square"); TargetPanelBG.Filled = true; TargetPanelBG.Color = Color3.fromRGB(14, 14, 18); TargetPanelBG.Transparency = 0.25
local TargetPanelAccent = Drawing.new("Square"); TargetPanelAccent.Filled = true; TargetPanelAccent.Transparency = 0
local TargetPanelName = Drawing.new("Text"); TargetPanelName.Size = 13; TargetPanelName.Font = Drawing.Fonts.Plex; TargetPanelName.Outline = true
local TargetPanelInfo1 = Drawing.new("Text"); TargetPanelInfo1.Size = 12; TargetPanelInfo1.Font = Drawing.Fonts.Plex; TargetPanelInfo1.Outline = true
local TargetPanelInfo2 = Drawing.new("Text"); TargetPanelInfo2.Size = 12; TargetPanelInfo2.Font = Drawing.Fonts.Plex; TargetPanelInfo2.Outline = true
local RaycastCountText = Drawing.new("Text"); RaycastCountText.Size = 13; RaycastCountText.Font = Drawing.Fonts.Plex; RaycastCountText.Outline = true; RaycastCountText.Center = false
local RaycastLines = {}
for i = 1, 12 do
    RaycastLines[i] = Drawing.new("Line")
    RaycastLines[i].Thickness = 1
    RaycastLines[i].Transparency = 0.2
    RaycastLines[i].Visible = false
end

-- Crosshair lines
local CrossLines = {}
for i = 1, 4 do
    CrossLines[i] = Drawing.new("Line")
    CrossLines[i].Thickness = 1; CrossLines[i].Visible = false
end
local CrossDot = Drawing.new("Circle")
CrossDot.Filled = true; CrossDot.Radius = 2; CrossDot.Visible = false

-- ESP Cache
local ESPCache = {}
local CurrentTarget = nil
local Connections = {}
local LastTriggerShot = 0
local SilentHookReady = false
local SilentHookAttempted = false
local RaycastsThisFrame = 0
local LastRaycastCount = 0

local function GetSilentTargetPosition()
    if not CurrentTarget then return nil end
    local targetPos = CurrentTarget.Position
    local lead = Settings.SilentExtraLead or 0
    if Settings.Prediction then
        lead = lead + (Settings.PredictionAmount or 0)
    end
    if lead > 0 then
        local vel = CurrentTarget.AssemblyLinearVelocity or CurrentTarget.Velocity or Vector3.new()
        targetPos = targetPos + vel * lead
    end
    return targetPos
end

function SetupSilentHook()
    -- Hard-disabled to avoid namecall detector trips.
    SilentHookAttempted = true
    SilentHookReady = false
end

SetupSilentHook()

local function GetESP(plr)
    if not ESPCache[plr] then
        local e = {
            Box = Drawing.new("Square"),
            BoxOutline = Drawing.new("Square"),
            BoxFill = Drawing.new("Square"),
            Name = Drawing.new("Text"),
            Distance = Drawing.new("Text"),
            Tracer = Drawing.new("Line"),
            HealthBarBG = Drawing.new("Square"),
            HealthBar = Drawing.new("Square"),
            Corners = {},
            WireMesh = {},
            WireTriangles = {},
        }
        e.Box.Thickness = 1; e.Box.Filled = false
        e.BoxOutline.Thickness = 2; e.BoxOutline.Filled = false; e.BoxOutline.Color = Color3.new(0, 0, 0)
        e.BoxFill.Filled = true; e.BoxFill.Transparency = 0.7
        e.Name.Center = true; e.Name.Size = 14; e.Name.Outline = true
        e.Distance.Center = true; e.Distance.Size = 13; e.Distance.Outline = true
        e.Tracer.Thickness = 1
        e.HealthBarBG.Filled = true; e.HealthBarBG.Color = Color3.new(0, 0, 0)
        e.HealthBar.Filled = true
        for i = 1, 8 do e.Corners[i] = Drawing.new("Line"); e.Corners[i].Thickness = 1.5 end
        for i = 1, 720 do
            local ln = Drawing.new("Line")
            ln.Thickness = 1.2
            ln.Transparency = 0
            ln.Visible = false
            e.WireMesh[i] = ln
        end
        for i = 1, 720 do
            local ok, tri = pcall(function()
                return Drawing.new("Triangle")
            end)
            if not ok or not tri then
                break
            end
            tri.Visible = false
            tri.Filled = true
            tri.Thickness = 1
            tri.Transparency = 0.35
            e.WireTriangles[i] = tri
        end
        ESPCache[plr] = e
    end
    return ESPCache[plr]
end

-- Cleanup ESP on player leave
Players.PlayerRemoving:Connect(function(plr)
    if ESPCache[plr] then
        for _, v in pairs(ESPCache[plr]) do
            if type(v) == "table" then
                for _, line in pairs(v) do pcall(function() line:Remove() end) end
            else pcall(function() v:Remove() end) end
        end
        ESPCache[plr] = nil
    end
end)

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  CORE FUNCTIONS
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ

-- Wall check (Raycast)
local function IsVisible(targetPart)
    if not Settings.WallCheck then return true end
    RaycastsThisFrame = RaycastsThisFrame + 1
    local params = RaycastParams.new()
    params.FilterDescendantsInstances = {Camera, Player.Character}
    params.FilterType = Enum.RaycastFilterType.Exclude
    params.IgnoreWater = true
    local cast = workspace:Raycast(Camera.CFrame.Position, targetPart.Position - Camera.CFrame.Position, params)
    if cast and cast.Instance then return cast.Instance:IsDescendantOf(targetPart.Parent) end
    return true
end

-- Team check
local function IsEnemy(plr)
    if not Settings.TeamCheck then return true end
    if plr.Team ~= nil and Player.Team ~= nil then
        return plr.Team ~= Player.Team
    end
    if plr.TeamColor ~= nil and Player.TeamColor ~= nil then
        return plr.TeamColor ~= Player.TeamColor
    end
    return true
end

local function FireMouseClick()
    local fired = false

    pcall(function()
        if mouse1click then
            mouse1click()
            fired = true
        end
    end)

    if not fired then
        pcall(function()
            if mouse1press and mouse1release then
                mouse1press()
                task.wait()
                mouse1release()
                fired = true
            end
        end)
    end

    if not fired then
        pcall(function()
            local vim = game:GetService("VirtualInputManager")
            local m = UIS:GetMouseLocation()
            vim:SendMouseButtonEvent(m.X, m.Y, 0, true, game, 0)
            vim:SendMouseButtonEvent(m.X, m.Y, 0, false, game, 0)
            fired = true
        end)
    end

    if not fired then
        pcall(function()
            local vu = game:GetService("VirtualUser")
            vu:Button1Down(Vector2.new(0, 0), Camera.CFrame)
            task.wait()
            vu:Button1Up(Vector2.new(0, 0), Camera.CFrame)
            fired = true
        end)
    end

    pcall(function()
        local char = Player.Character
        if not char then return end
        local hum = char:FindFirstChildOfClass("Humanoid")
        local tool = char:FindFirstChildOfClass("Tool")
        if not tool then
            local backpack = Player:FindFirstChildOfClass("Backpack")
            if backpack then
                tool = backpack:FindFirstChildOfClass("Tool")
                if tool and hum then
                    hum:EquipTool(tool)
                end
            end
        end
        if tool then
            tool:Activate()
        end
    end)
end

local function GetCharacterTargetPart(char)
    if not char then return nil end
    local preferred = char:FindFirstChild(Settings.HitPart)
    if preferred and preferred:IsA("BasePart") then
        return preferred
    end
    local fallbacks = {"Head", "HumanoidRootPart", "UpperTorso", "LowerTorso", "Torso"}
    for _, name in ipairs(fallbacks) do
        local part = char:FindFirstChild(name)
        if part and part:IsA("BasePart") then
            return part
        end
    end
    return char:FindFirstChildWhichIsA("BasePart")
end

local WIRE_PART_PRIORITY = {
    Head = 1, UpperTorso = 2, LowerTorso = 3, Torso = 3, HumanoidRootPart = 4,
    LeftUpperArm = 5, RightUpperArm = 5, LeftLowerArm = 6, RightLowerArm = 6,
    LeftHand = 7, RightHand = 7, LeftUpperLeg = 8, RightUpperLeg = 8,
    LeftLowerLeg = 9, RightLowerLeg = 9, LeftFoot = 10, RightFoot = 10,
}

local function HideWireMesh(esp)
    if not esp then return end
    if esp.WireMesh then
        for i = 1, #esp.WireMesh do
            esp.WireMesh[i].Visible = false
        end
    end
    if esp.WireTriangles then
        for i = 1, #esp.WireTriangles do
            esp.WireTriangles[i].Visible = false
        end
    end
end

local function UpdateWireframe(char)
    -- Legacy cleanup from old SelectionBox implementation.
    if not char then return end
    for _, part in pairs(char:GetDescendants()) do
        if part:IsA("BasePart") then
            local wire = part:FindFirstChild("FlickWireBox")
            if wire then
                wire.Visible = false
            end
        end
    end
end

local WIRE_FACE_BUILDERS = {
    function(sx, sy, sz, u, v) return Vector3.new( sx, -sy + 2 * sy * u, -sz + 2 * sz * v) end,
    function(sx, sy, sz, u, v) return Vector3.new(-sx, -sy + 2 * sy * u, -sz + 2 * sz * v) end,
    function(sx, sy, sz, u, v) return Vector3.new(-sx + 2 * sx * u,  sy, -sz + 2 * sz * v) end,
    function(sx, sy, sz, u, v) return Vector3.new(-sx + 2 * sx * u, -sy, -sz + 2 * sz * v) end,
    function(sx, sy, sz, u, v) return Vector3.new(-sx + 2 * sx * u, -sy + 2 * sy * v,  sz) end,
    function(sx, sy, sz, u, v) return Vector3.new(-sx + 2 * sx * u, -sy + 2 * sy * v, -sz) end,
}

local function RenderWireMeshForCharacter(esp, char, color, thickness, linesBudget, drawEdges, drawFaces)
    if not esp or not char then return end
    local hasLines = drawEdges and esp.WireMesh and #esp.WireMesh > 0
    local hasTris = drawFaces and esp.WireTriangles and #esp.WireTriangles > 0
    if not hasLines and not hasTris then return end

    local maxBudget = math.clamp(math.floor(tonumber(linesBudget) or 240), 24, 600)
    local maxLines = hasLines and math.min(maxBudget, #esp.WireMesh) or 0
    local maxTris = hasTris and math.min(maxBudget, #esp.WireTriangles) or 0
    local wireThickness = math.clamp(tonumber(thickness) or 1.2, 0.5, 5)
    local lineCursor = 1
    local triCursor = 1

    local parts = {}
    for _, part in pairs(char:GetDescendants()) do
        if part:IsA("BasePart") and part.Transparency < 1 and part.Size.Magnitude > 0.1 then
            table.insert(parts, part)
        end
    end
    table.sort(parts, function(a, b)
        local pa = WIRE_PART_PRIORITY[a.Name] or 99
        local pb = WIRE_PART_PRIORITY[b.Name] or 99
        if pa == pb then
            return a.Size.Magnitude > b.Size.Magnitude
        end
        return pa < pb
    end)

    local partCount = math.max(1, #parts)
    local budgetPerPart = math.max(12, math.floor(maxBudget / partCount))
    local subdivisions = 1
    for d = 1, 10 do
        local perFace = 0
        if hasLines then
            perFace = perFace + (3 * d * d + 2 * d)
        end
        if hasTris then
            perFace = perFace + (2 * d * d)
        end
        local estimate = 6 * perFace
        if estimate <= budgetPerPart then
            subdivisions = d
        else
            break
        end
    end

    local function DrawLine(a, b)
        if not hasLines or lineCursor > maxLines or not a or not b then return end
        local ln = esp.WireMesh[lineCursor]
        ln.Visible = true
        ln.From = a
        ln.To = b
        ln.Color = Color3.new(0, 0, 0)
        ln.Thickness = wireThickness
        lineCursor = lineCursor + 1
    end

    local function DrawTriangle(a, b, c)
        if not hasTris or triCursor > maxTris or not a or not b or not c then return end
        local tri = esp.WireTriangles[triCursor]
        tri.Visible = true
        tri.PointA = a
        tri.PointB = b
        tri.PointC = c
        tri.Color = color
        tri.Transparency = math.clamp(1 - (Settings.ChamTransparency or 0.5), 0.1, 0.95)
        triCursor = triCursor + 1
    end

    for _, part in ipairs(parts) do
        if (not hasLines or lineCursor > maxLines) and (not hasTris or triCursor > maxTris) then break end
        local cf = part.CFrame
        local sx, sy, sz = part.Size.X * 0.5, part.Size.Y * 0.5, part.Size.Z * 0.5

        for _, BuildFacePoint in ipairs(WIRE_FACE_BUILDERS) do
            if (not hasLines or lineCursor > maxLines) and (not hasTris or triCursor > maxTris) then break end
            local grid = {}
            for i = 1, subdivisions + 1 do
                grid[i] = {}
                local u = (i - 1) / subdivisions
                for j = 1, subdivisions + 1 do
                    local v = (j - 1) / subdivisions
                    local localPoint = BuildFacePoint(sx, sy, sz, u, v)
                    local worldPoint = cf:PointToWorldSpace(localPoint)
                    local screenPoint, vis = Camera:WorldToViewportPoint(worldPoint)
                    if vis and screenPoint.Z > 0 then
                        grid[i][j] = Vector2.new(screenPoint.X, screenPoint.Y)
                    end
                end
            end

            if hasLines then
                -- Horizontal grid lines.
                for i = 1, subdivisions + 1 do
                    for j = 1, subdivisions do
                        DrawLine(grid[i][j], grid[i][j + 1])
                        if lineCursor > maxLines then break end
                    end
                    if lineCursor > maxLines then break end
                end
                if lineCursor > maxLines then break end

                -- Vertical grid lines.
                for j = 1, subdivisions + 1 do
                    for i = 1, subdivisions do
                        DrawLine(grid[i][j], grid[i + 1][j])
                        if lineCursor > maxLines then break end
                    end
                    if lineCursor > maxLines then break end
                end
                if lineCursor > maxLines then break end
            end

            for i = 1, subdivisions do
                for j = 1, subdivisions do
                    local p00 = grid[i][j]
                    local p01 = grid[i][j + 1]
                    local p10 = grid[i + 1][j]
                    local p11 = grid[i + 1][j + 1]
                    if (i + j) % 2 == 0 then
                        if hasLines then DrawLine(p00, p11) end
                        if hasTris then
                            DrawTriangle(p00, p10, p11)
                            DrawTriangle(p00, p11, p01)
                        end
                    else
                        if hasLines then DrawLine(p10, p01) end
                        if hasTris then
                            DrawTriangle(p00, p10, p01)
                            DrawTriangle(p10, p11, p01)
                        end
                    end
                    if (not hasLines or lineCursor > maxLines) and (not hasTris or triCursor > maxTris) then break end
                end
                if (not hasLines or lineCursor > maxLines) and (not hasTris or triCursor > maxTris) then break end
            end
        end
    end

    if esp.WireMesh then
        for i = lineCursor, #esp.WireMesh do
            esp.WireMesh[i].Visible = false
        end
    end
    if esp.WireTriangles then
        for i = triCursor, #esp.WireTriangles do
            esp.WireTriangles[i].Visible = false
        end
    end
end

-- Get closest target
local function UpdateTarget()
    local target, dist = nil, math.max(Settings.FOV, 1)
    local mouse = UIS:GetMouseLocation()
    for _, p in pairs(Players:GetPlayers()) do
        if p ~= Player and p.Character and IsEnemy(p) then
            local part = GetCharacterTargetPart(p.Character)
            local hum = p.Character:FindFirstChildOfClass("Humanoid")
            if part and hum and hum.Health > 0 then
                local pos, vis = Camera:WorldToViewportPoint(part.Position)
                if vis then
                    local mDist = (Vector2.new(pos.X, pos.Y) - mouse).Magnitude
                    if mDist < dist and IsVisible(part) then
                        dist = mDist; target = part
                    end
                end
            end
        end
    end
    return target
end

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  AIMBOT INPUT
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
UIS.InputBegan:Connect(function(input, proc)
    if not Settings.Enabled then return end
    if proc and input.UserInputType ~= Enum.UserInputType.MouseButton1 then return end
    
    -- Silent aim on click
    if input.UserInputType == Enum.UserInputType.MouseButton1 and Settings.SilentAim then
        local clickTarget = CurrentTarget or UpdateTarget()
        if clickTarget then
            CurrentTarget = clickTarget
        end
        -- If hook is unavailable in executor, fallback to camera flick.
        if CurrentTarget and not SilentHookReady then
            local targetPos = GetSilentTargetPosition()
            if targetPos then
                local oldCF = Camera.CFrame
                Camera.CFrame = CFrame.new(Camera.CFrame.Position, targetPos)
                if Settings.SilentForceShot then
                    FireMouseClick()
                end
                task.wait(math.max(Settings.ShotDelay or 0, 0))
                Camera.CFrame = oldCF
            end
        end
    end
    
    -- Click TP
    if Settings.ClickTP and input.UserInputType == Enum.UserInputType.MouseButton1 and UIS:IsKeyDown(Enum.KeyCode.LeftControl) then
        pcall(function()
            local mouse = Player:GetMouse()
            if mouse.Target then
                Player.Character.HumanoidRootPart.CFrame = CFrame.new(mouse.Hit.Position + Vector3.new(0, 3, 0))
            end
        end)
    end
end)

-- Infinite jump
UIS.JumpRequest:Connect(function()
    if Settings.InfJumpEnabled then
        pcall(function() Player.Character:FindFirstChildOfClass("Humanoid"):ChangeState(Enum.HumanoidStateType.Jumping) end)
    end
end)

-- Anti-AFK
Player.Idled:Connect(function()
    if Settings.AntiAFK then
        pcall(function()
            local VU = game:GetService("VirtualUser")
            VU:Button2Down(Vector2.new(), workspace.CurrentCamera.CFrame)
            task.wait(1)
            VU:Button2Up(Vector2.new(), workspace.CurrentCamera.CFrame)
        end)
    end
end)

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  MAIN RENDER LOOP
-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
RunService.RenderStepped:Connect(function()
    Camera = workspace.CurrentCamera
    RaycastsThisFrame = 0
    CurrentTarget = UpdateTarget()
    LastRaycastCount = RaycastsThisFrame
    local RGB = Color3.fromHSV(tick() % 5 / 5, 1, 1)
    local VP = Camera.ViewportSize
    local center = Vector2.new(VP.X / 2, VP.Y / 2)
    local mousePos = UIS:GetMouseLocation()

    -- FOV Circle
    FOVCircle.Visible = Settings.Enabled and Settings.ShowFOV
    FOVCircle.Radius = Settings.FOV
    FOVCircle.Position = mousePos
    FOVCircle.Color = Settings.FOVColor

    -- Raycast visuals (screen lines to nearest targets)
    for i = 1, #RaycastLines do
        RaycastLines[i].Visible = false
    end
    if Settings.Enabled and Settings.RaycastVisuals then
        local pool = {}
        for _, p in pairs(Players:GetPlayers()) do
            if p ~= Player and p.Character and IsEnemy(p) then
                local part = p.Character:FindFirstChild(Settings.HitPart)
                local hum = p.Character:FindFirstChildOfClass("Humanoid")
                if part and hum and hum.Health > 0 then
                    local pos, vis = Camera:WorldToViewportPoint(part.Position)
                    if vis then
                        local scr = Vector2.new(pos.X, pos.Y)
                        local d = (scr - mousePos).Magnitude
                        if d <= Settings.FOV then
                            table.insert(pool, {ScreenPos = scr, Dist = d})
                        end
                    end
                end
            end
        end
        table.sort(pool, function(a, b) return a.Dist < b.Dist end)
        local maxLines = math.min(Settings.RaycastMaxLines, #RaycastLines, #pool)
        for i = 1, maxLines do
            local line = RaycastLines[i]
            line.From = mousePos
            line.To = pool[i].ScreenPos
            line.Color = Settings.RaycastColor
            line.Visible = true
        end
    end

    RaycastCountText.Visible = Settings.Enabled and Settings.RaycastShowCount
    if RaycastCountText.Visible then
        RaycastCountText.Text = "Raycasts: " .. tostring(LastRaycastCount)
        RaycastCountText.Position = Vector2.new(mousePos.X + 16, mousePos.Y + 16)
        RaycastCountText.Color = Settings.RaycastColor
    end

    -- Target visuals
    if CurrentTarget and Settings.Enabled then
        local pos, vis = Camera:WorldToViewportPoint(CurrentTarget.Position)
        if vis then
            local tPos = Vector2.new(pos.X, pos.Y)
            TargetLine.Visible = Settings.TargetTracer
            TargetLine.From = center
            TargetLine.To = tPos
            TargetLine.Color = Settings.TargetColor
            TargetCircle.Visible = Settings.TargetESP
            TargetCircle.Position = tPos
            TargetCircle.Color = Settings.TargetColor
            local showPanel = Settings.TargetPanel
            if showPanel then
                local targetChar = CurrentTarget.Parent
                local targetHum = targetChar and targetChar:FindFirstChildOfClass("Humanoid")
                local nameText = targetChar and targetChar.Name or "Target"
                local hpText = targetHum and (math.floor(targetHum.Health) .. " / " .. math.floor(targetHum.MaxHealth) .. " HP") or "HP: ?"
                local distText = "DST: ?"
                if Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") then
                    local d = (Player.Character.HumanoidRootPart.Position - CurrentTarget.Position).Magnitude
                    distText = "DST: " .. math.floor(d)
                end

                local panelW, panelH = 150, 52
                local px, py = tPos.X + 18, tPos.Y + 10
                if px + panelW > VP.X - 6 then px = tPos.X - panelW - 18 end
                if py + panelH > VP.Y - 6 then py = tPos.Y - panelH - 10 end

                TargetPanelBG.Visible = true
                TargetPanelBG.Position = Vector2.new(px, py)
                TargetPanelBG.Size = Vector2.new(panelW, panelH)
                TargetPanelAccent.Visible = true
                TargetPanelAccent.Position = Vector2.new(px, py)
                TargetPanelAccent.Size = Vector2.new(panelW, 2)
                TargetPanelAccent.Color = Settings.TargetColor
                TargetPanelName.Visible = true
                TargetPanelName.Position = Vector2.new(px + 6, py + 4)
                TargetPanelName.Text = nameText
                TargetPanelName.Color = Color3.fromRGB(240, 240, 245)
                TargetPanelInfo1.Visible = true
                TargetPanelInfo1.Position = Vector2.new(px + 6, py + 22)
                TargetPanelInfo1.Text = hpText
                TargetPanelInfo1.Color = Color3.fromRGB(210, 210, 220)
                TargetPanelInfo2.Visible = true
                TargetPanelInfo2.Position = Vector2.new(px + 6, py + 36)
                TargetPanelInfo2.Text = distText
                TargetPanelInfo2.Color = Color3.fromRGB(210, 210, 220)
            else
                TargetPanelBG.Visible = false; TargetPanelAccent.Visible = false
                TargetPanelName.Visible = false; TargetPanelInfo1.Visible = false; TargetPanelInfo2.Visible = false
            end
        else
            TargetLine.Visible = false; TargetCircle.Visible = false
            TargetPanelBG.Visible = false; TargetPanelAccent.Visible = false
            TargetPanelName.Visible = false; TargetPanelInfo1.Visible = false; TargetPanelInfo2.Visible = false
        end
    else
        TargetLine.Visible = false; TargetCircle.Visible = false
        TargetPanelBG.Visible = false; TargetPanelAccent.Visible = false
        TargetPanelName.Visible = false; TargetPanelInfo1.Visible = false; TargetPanelInfo2.Visible = false
    end

    -- Continuous aimbot lock (SilentAim off = visible lock)
    if Settings.Enabled and CurrentTarget and not Settings.SilentAim then
        local targetPos = CurrentTarget.Position
        if Settings.Prediction then
            local vel = CurrentTarget.AssemblyLinearVelocity or CurrentTarget.Velocity or Vector3.new()
            targetPos = targetPos + vel * Settings.PredictionAmount
        end
        local targetCF = CFrame.new(Camera.CFrame.Position, targetPos)
        if Settings.Smoothing then
            Camera.CFrame = Camera.CFrame:Lerp(targetCF, 1 / math.max(Settings.SmoothFactor, 1))
        else
            Camera.CFrame = targetCF
        end
    end

    -- Auto fire / Triggerbot (uses aimbot FOV, not crosshair)
    if (Settings.AutoFire or Settings.TriggerBot) and Settings.Enabled and CurrentTarget then
        pcall(function()
            local pos, vis = Camera:WorldToViewportPoint(CurrentTarget.Position)
            if vis then
                local dist = (Vector2.new(pos.X, pos.Y) - mousePos).Magnitude
                if dist <= Settings.FOV and (tick() - LastTriggerShot) >= Settings.TriggerDelay then
                    LastTriggerShot = tick()
                    FireMouseClick()
                end
            end
        end)
    end

    -- в•ђв•ђ HITBOX SINK в•ђв•ђ
    -- HipHeight метод: физика держит персонажа на земле, но HRP уходит ниже
    pcall(function()
        local char = Player.Character
        if not char then return end
        local hrp = char:FindFirstChild("HumanoidRootPart")
        local hum = char:FindFirstChildOfClass("Humanoid")
        if not hrp or not hum then return end

        if Settings.HitboxSink then
            local depth = Settings.HitboxSinkDepth

            -- Сохраняем оригинальные значения при первом включении
            if not hrp:FindFirstChild("FlickSinkAnchor") then
                local marker = Instance.new("NumberValue")
                marker.Name = "FlickSinkAnchor"
                marker.Value = hum.HipHeight  -- запоминаем оригинальный HipHeight
                marker.Parent = hrp
                -- Запоминаем оригинальные Motor6D offsets
                for _, motor in pairs(char:GetDescendants()) do
                    if motor:IsA("Motor6D") and motor.Part0 == hrp then
                        motor:SetAttribute("OrigC0Y", motor.C0.Position.Y)
                    end
                end
            end

            -- HipHeight = отрицательный → HRP опускается под землю
            -- Физика НЕ ломается, персонаж ходит по земле нормально
            hum.HipHeight = -depth

            -- Motor6D компенсация: визуально поднимаем тело обратно наверх
            for _, motor in pairs(char:GetDescendants()) do
                if motor:IsA("Motor6D") and motor.Part0 == hrp then
                    local origY = motor:GetAttribute("OrigC0Y") or 0
                    local pos3 = motor.C0.Position
                    motor.C0 = CFrame.new(pos3.X, origY + depth, pos3.Z) * (motor.C0 - motor.C0.Position)
                end
            end

        elseif hrp:FindFirstChild("FlickSinkAnchor") then
            -- Восстанавливаем всё при выключении
            local origHH = hrp:FindFirstChild("FlickSinkAnchor").Value
            hum.HipHeight = origHH

            for _, motor in pairs(char:GetDescendants()) do
                if motor:IsA("Motor6D") and motor.Part0 == hrp then
                    local origY = motor:GetAttribute("OrigC0Y")
                    if origY then
                        local pos3 = motor.C0.Position
                        motor.C0 = CFrame.new(pos3.X, origY, pos3.Z) * (motor.C0 - motor.C0.Position)
                    end
                end
            end
            hrp:FindFirstChild("FlickSinkAnchor"):Destroy()
        end

        -- Hitbox Desync (Jitter) — использует HipHeight для дёрганья
        if Settings.HitboxDesync and not Settings.HitboxSink then
            local offset = Settings.HitboxDesyncOffset
            local jitter = math.abs(math.sin(tick() * 15)) * offset
            hum.HipHeight = -jitter
        elseif not Settings.HitboxSink and not Settings.HitboxDesync then
            -- Восстанавливаем HipHeight если оба выключены
            if hrp:GetAttribute("OrigHipHeight") then
                hum.HipHeight = hrp:GetAttribute("OrigHipHeight")
            end
        end
    end)

    -- Crosshair
    if Settings.CrosshairEnabled then
        local sz, gap, clr, thk = Settings.CrosshairSize, Settings.CrosshairGap, Settings.CrosshairColor, Settings.CrosshairThickness
        -- Top
        CrossLines[1].Visible = true; CrossLines[1].From = center - Vector2.new(0, gap); CrossLines[1].To = center - Vector2.new(0, gap + sz); CrossLines[1].Color = clr; CrossLines[1].Thickness = thk
        -- Bottom
        CrossLines[2].Visible = true; CrossLines[2].From = center + Vector2.new(0, gap); CrossLines[2].To = center + Vector2.new(0, gap + sz); CrossLines[2].Color = clr; CrossLines[2].Thickness = thk
        -- Left
        CrossLines[3].Visible = true; CrossLines[3].From = center - Vector2.new(gap, 0); CrossLines[3].To = center - Vector2.new(gap + sz, 0); CrossLines[3].Color = clr; CrossLines[3].Thickness = thk
        -- Right
        CrossLines[4].Visible = true; CrossLines[4].From = center + Vector2.new(gap, 0); CrossLines[4].To = center + Vector2.new(gap + sz, 0); CrossLines[4].Color = clr; CrossLines[4].Thickness = thk
        CrossDot.Visible = Settings.DotEnabled; CrossDot.Position = center; CrossDot.Color = clr
    else
        for i = 1, 4 do CrossLines[i].Visible = false end; CrossDot.Visible = false
    end

    -- Lighting
    if Settings.Fullbright then Lighting.Brightness = 2; Lighting.ClockTime = 14; Lighting.GlobalShadows = false; Lighting.Ambient = Settings.AmbientColor end
    if Settings.NoFog then Lighting.FogEnd = 999999; Lighting.FogStart = 999999 end
    if Settings.CustomTime then Lighting.ClockTime = Settings.TimeValue end

    -- Post processing
    if Settings.BloomEnabled then
        if not BloomEffect then
            BloomEffect = Instance.new("BloomEffect")
            BloomEffect.Name = "FlickBloom"
            BloomEffect.Parent = Lighting
        end
        BloomEffect.Enabled = true
        BloomEffect.Intensity = Settings.BloomIntensity
        BloomEffect.Size = Settings.BloomSize
        BloomEffect.Threshold = Settings.BloomThreshold
    elseif BloomEffect then
        BloomEffect.Enabled = false
    end

    if Settings.ColorCorrectionEnabled then
        if not ColorCorrectionEffect then
            ColorCorrectionEffect = Instance.new("ColorCorrectionEffect")
            ColorCorrectionEffect.Name = "FlickColorCorrection"
            ColorCorrectionEffect.Parent = Lighting
        end
        ColorCorrectionEffect.Enabled = true
        ColorCorrectionEffect.Contrast = Settings.ColorCorrectionContrast
        ColorCorrectionEffect.Saturation = Settings.ColorCorrectionSaturation
        ColorCorrectionEffect.TintColor = Settings.ColorCorrectionTint
    elseif ColorCorrectionEffect then
        ColorCorrectionEffect.Enabled = false
    end

    -- Movement
    pcall(function()
        local char = Player.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        local hrp = char and char:FindFirstChild("HumanoidRootPart")
        if hum then
            if Settings.SpeedEnabled then hum.WalkSpeed = Settings.SpeedValue end
            if Settings.JumpPower then hum.JumpPower = Settings.JumpValue end
        end

        -- Noclip
        if Settings.NoclipEnabled and char then
            for _, p in pairs(char:GetDescendants()) do
                if p:IsA("BasePart") then p.CanCollide = false end
            end
        end

        -- Fly
        if Settings.FlyEnabled and hrp then
            local bp = hrp:FindFirstChild("FlickBP")
            local bg = hrp:FindFirstChild("FlickBG")
            if not bp then bp = Instance.new("BodyPosition") bp.Name = "FlickBP" bp.MaxForce = Vector3.new() bp.Parent = hrp end
            if not bg then bg = Instance.new("BodyGyro") bg.Name = "FlickBG" bg.MaxTorque = Vector3.new() bg.Parent = hrp end

            if UIS:IsKeyDown(Enum.KeyCode.Space) then
                bp.MaxForce = Vector3.new(9e4, 9e4, 9e4)
                bg.MaxTorque = Vector3.new(9e4, 9e4, 9e4)
                bg.CFrame = Camera.CFrame
                local md = Vector3.new()
                if UIS:IsKeyDown(Enum.KeyCode.W) then md = md + Camera.CFrame.LookVector end
                if UIS:IsKeyDown(Enum.KeyCode.S) then md = md - Camera.CFrame.LookVector end
                if UIS:IsKeyDown(Enum.KeyCode.A) then md = md - Camera.CFrame.RightVector end
                if UIS:IsKeyDown(Enum.KeyCode.D) then md = md + Camera.CFrame.RightVector end
                bp.Position = md.Magnitude > 0 and hrp.Position + md.Unit * (Settings.FlySpeed / 25) or hrp.Position + Vector3.new(0, 0.2, 0)
            else bp.MaxForce = Vector3.new(); bg.MaxTorque = Vector3.new() end
        end
    end)

    -- Render players ESP + Chams
    for _, p in pairs(Players:GetPlayers()) do
        if p ~= Player then
            local esp = GetESP(p)
            local char = p.Character
            if char and char:FindFirstChild("HumanoidRootPart") and char:FindFirstChild("Head") then
                local hum = char:FindFirstChildOfClass("Humanoid")
                if hum and hum.Health > 0 then
                    -- Highlight (Chams/Glow)
                    local hl = char:FindFirstChild("FlickHL")
                    if not hl then hl = Instance.new("Highlight") hl.Name = "FlickHL" hl.Parent = char end
                    local chamType = Settings.ChamType or "Fill"
                    local showWire = Settings.ChamsEnabled and (chamType == "Wireframe" or chamType == "Fill+Wireframe" or chamType == "TriMesh")
                    local showTriFill = Settings.ChamsEnabled and (chamType == "TriFill" or chamType == "TriMesh")
                    local showFill = Settings.ChamsEnabled and (chamType == "Fill" or chamType == "Flat" or chamType == "Fill+Wireframe")
                    local showChamOutline = Settings.ChamsEnabled and (chamType == "Outline" or chamType == "Flat")
                    local showWireWallOutline = showWire or showTriFill
                    local showOutline = Settings.GlowEnabled or showChamOutline or showWireWallOutline
                    hl.Enabled = showFill or showOutline
                    hl.FillColor = Settings.ChamColor
                    hl.OutlineColor = showWireWallOutline and Settings.ChamColor or (Settings.RainbowGlow and RGB or Settings.GlowColor)
                    hl.FillTransparency = showFill and Settings.ChamTransparency or 1
                    hl.OutlineTransparency = showOutline and 0 or 1
                    hl.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
                    UpdateWireframe(char)
                    if showWire or showTriFill then
                        RenderWireMeshForCharacter(esp, char, Settings.ChamColor, Settings.ChamWireThickness, Settings.ChamWireLines, showWire, showTriFill)
                    else
                        HideWireMesh(esp)
                    end

                    local hrp = char.HumanoidRootPart
                    local head = char.Head
                    local pos, vis = Camera:WorldToViewportPoint(hrp.Position)
                    local headPos = Camera:WorldToViewportPoint(head.Position + Vector3.new(0, 0.5, 0))
                    local legPos = Camera:WorldToViewportPoint(hrp.Position - Vector3.new(0, 3, 0))

                    if vis then
                        local height = math.abs(headPos.Y - legPos.Y)
                        local width = height / 2
                        local topLeft = Vector2.new(pos.X - width / 2, headPos.Y)

                        -- Box visuals
                        local showCorners = Settings.CornerBoxes
                        local showBox = Settings.Boxes and not showCorners
                        local showFill = Settings.BoxFill and (showBox or showCorners)

                        esp.BoxOutline.Visible = showBox
                        esp.Box.Visible = showBox
                        if showBox then
                            esp.BoxOutline.Size = Vector2.new(width, height)
                            esp.BoxOutline.Position = topLeft
                            esp.Box.Size = Vector2.new(width, height)
                            esp.Box.Position = topLeft
                            esp.Box.Color = Settings.BoxColor
                        end

                        esp.BoxFill.Visible = showFill
                        if showFill then
                            esp.BoxFill.Size = Vector2.new(width, height)
                            esp.BoxFill.Position = topLeft
                            esp.BoxFill.Color = Settings.BoxFillColor
                            esp.BoxFill.Transparency = Settings.BoxFillTransparency
                        end

                        for i = 1, 8 do esp.Corners[i].Visible = false end
                        if showCorners then
                            local cornerMax = math.max(3, math.floor(math.min(width, height) / 2))
                            local cornerLen = math.clamp(Settings.CornerLength, 3, cornerMax)
                            local x, y = topLeft.X, topLeft.Y
                            local w, h = width, height
                            local c = Settings.BoxColor
                            local corners = esp.Corners

                            corners[1].Visible = true; corners[1].From = Vector2.new(x, y); corners[1].To = Vector2.new(x + cornerLen, y); corners[1].Color = c
                            corners[2].Visible = true; corners[2].From = Vector2.new(x, y); corners[2].To = Vector2.new(x, y + cornerLen); corners[2].Color = c
                            corners[3].Visible = true; corners[3].From = Vector2.new(x + w - cornerLen, y); corners[3].To = Vector2.new(x + w, y); corners[3].Color = c
                            corners[4].Visible = true; corners[4].From = Vector2.new(x + w, y); corners[4].To = Vector2.new(x + w, y + cornerLen); corners[4].Color = c
                            corners[5].Visible = true; corners[5].From = Vector2.new(x, y + h - cornerLen); corners[5].To = Vector2.new(x, y + h); corners[5].Color = c
                            corners[6].Visible = true; corners[6].From = Vector2.new(x, y + h); corners[6].To = Vector2.new(x + cornerLen, y + h); corners[6].Color = c
                            corners[7].Visible = true; corners[7].From = Vector2.new(x + w - cornerLen, y + h); corners[7].To = Vector2.new(x + w, y + h); corners[7].Color = c
                            corners[8].Visible = true; corners[8].From = Vector2.new(x + w, y + h - cornerLen); corners[8].To = Vector2.new(x + w, y + h); corners[8].Color = c
                        end

                        -- Name
                        esp.Name.Visible = Settings.Names
                        esp.Name.Text = p.DisplayName
                        esp.Name.Position = Vector2.new(pos.X, headPos.Y - 18)
                        esp.Name.Color = Settings.NameColor

                        -- Distance
                        esp.Distance.Visible = Settings.Distance
                        if Player.Character and Player.Character:FindFirstChild("HumanoidRootPart") then
                            esp.Distance.Text = math.floor((Player.Character.HumanoidRootPart.Position - hrp.Position).Magnitude) .. "m"
                        end
                        esp.Distance.Position = Vector2.new(pos.X, legPos.Y + 4)
                        esp.Distance.Color = Settings.DistanceColor

                        -- Tracer
                        esp.Tracer.Visible = Settings.Tracers
                        esp.Tracer.From = Vector2.new(VP.X / 2, VP.Y)
                        esp.Tracer.To = Vector2.new(pos.X, legPos.Y)
                        esp.Tracer.Color = Settings.TracerColor

                        -- Health Bar
                        if Settings.HealthBar then
                            local barW = 3
                            local barH = height
                            local barX = topLeft.X - barW - 3
                            local barY = headPos.Y
                            local healthPct = math.clamp(hum.Health / hum.MaxHealth, 0, 1)
                            esp.HealthBarBG.Visible = true
                            esp.HealthBarBG.Position = Vector2.new(barX, barY)
                            esp.HealthBarBG.Size = Vector2.new(barW, barH)
                            esp.HealthBar.Visible = true
                            esp.HealthBar.Position = Vector2.new(barX, barY + barH * (1 - healthPct))
                            esp.HealthBar.Size = Vector2.new(barW, barH * healthPct)
                            esp.HealthBar.Color = Color3.fromRGB(255 * (1 - healthPct), 255 * healthPct, 0)
                        else esp.HealthBarBG.Visible = false; esp.HealthBar.Visible = false end

                    else
                        esp.Box.Visible = false; esp.BoxOutline.Visible = false; esp.Name.Visible = false
                    esp.BoxFill.Visible = false
                    for i = 1, 8 do esp.Corners[i].Visible = false end
                    esp.Distance.Visible = false; esp.Tracer.Visible = false
                    esp.HealthBar.Visible = false; esp.HealthBarBG.Visible = false
                    HideWireMesh(esp)
                end
            else
                -- Dead player - clean visuals
                esp.Box.Visible = false; esp.BoxOutline.Visible = false; esp.Name.Visible = false
                esp.BoxFill.Visible = false
                for i = 1, 8 do esp.Corners[i].Visible = false end
                esp.Distance.Visible = false; esp.Tracer.Visible = false
                esp.HealthBar.Visible = false; esp.HealthBarBG.Visible = false
                if char:FindFirstChild("FlickHL") then char.FlickHL.Enabled = false end
                UpdateWireframe(char)
                HideWireMesh(esp)
            end
        else
            esp.Box.Visible = false; esp.BoxOutline.Visible = false; esp.Name.Visible = false
            esp.BoxFill.Visible = false
            for i = 1, 8 do esp.Corners[i].Visible = false end
            esp.Distance.Visible = false; esp.Tracer.Visible = false
            esp.HealthBar.Visible = false; esp.HealthBarBG.Visible = false
            HideWireMesh(esp)
            if char then
                if char:FindFirstChild("FlickHL") then char.FlickHL.Enabled = false end
                UpdateWireframe(char)
            end
        end
        end
    end

    -- в•ђв•ђ PARTICLES в•ђв•ђ
    pcall(function()
        local char = Player.Character
        if not char then return end
        local hrp = char:FindFirstChild("HumanoidRootPart")
        if not hrp then return end
        local RGB = Color3.fromHSV(tick() % 5 / 5, 1, 1)
        if not char:FindFirstChild("FlickFXClean") then
            local tag = Instance.new("BoolValue")
            tag.Name = "FlickFXClean"
            tag.Parent = char
            for _, obj in pairs(char:GetDescendants()) do
                if obj.Name == "FlickSparkle" or obj.Name == "FlickFire" or obj.Name == "FlickSmoke" or obj.Name == "FlickParticle" then
                    obj:Destroy()
                end
            end
        end

        -- Trail
        if Settings.TrailEnabled then
            local head = char:FindFirstChild("Head")
            if hrp and head and not hrp:FindFirstChild("FlickTrail") then
                local a0 = Instance.new("Attachment") a0.Name = "FlickTrailA" a0.Position = Vector3.new(0, 1, 0) a0.Parent = hrp
                local a1 = Instance.new("Attachment") a1.Name = "FlickTrailB" a1.Position = Vector3.new(0, -2, 0) a1.Parent = hrp
                local tr = Instance.new("Trail") tr.Name = "FlickTrail"
                tr.Attachment0 = a0; tr.Attachment1 = a1
                tr.Lifetime = Settings.TrailLifetime; tr.LightEmission = 1
                tr.MinLength = 0; tr.FaceCamera = true
                tr.Parent = hrp
            end
            local tr = hrp:FindFirstChild("FlickTrail")
            if tr then
                tr.Lifetime = Settings.TrailLifetime
                local tCol = Settings.RainbowParticles and RGB or Settings.TrailColor
                tr.Color = ColorSequence.new(tCol)
                tr.Transparency = NumberSequence.new({NumberSequenceKeypoint.new(0, 0), NumberSequenceKeypoint.new(1, 1)})
                tr.Enabled = true
            end
        end

        -- Aura
        if Settings.AuraEnabled then
            if not hrp:FindFirstChild("FlickAura") then
                local pe = Instance.new("ParticleEmitter") pe.Name = "FlickAura"
                pe.Texture = "rbxassetid://243098098"
                pe.Rate = 50; pe.Speed = NumberRange.new(0.5, 2)
                pe.Size = NumberSequence.new({NumberSequenceKeypoint.new(0, 1.5), NumberSequenceKeypoint.new(1, 0)})
                pe.Lifetime = NumberRange.new(0.5, 1); pe.LightEmission = 1; pe.LightInfluence = 0
                pe.SpreadAngle = Vector2.new(180, 180)
                pe.Parent = hrp
            end
            local aura = hrp:FindFirstChild("FlickAura")
            if aura then aura.Color = ColorSequence.new(Settings.RainbowParticles and RGB or Settings.AuraColor); aura.Enabled = true end
        end
    end)
end)

-- в•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђв•ђ
--  HUD + Notifications + ArrayList (Drawing API) - MODERN CLEAN HUD
-- =============================================================
local VisualUI = {}

local function Lerp(a, b, t)
    return a + (b - a) * t
end

local function LerpV2(a, b, t)
    return Vector2.new(Lerp(a.X, b.X, t), Lerp(a.Y, b.Y, t))
end

local function HSVGradient(speed)
    local h = (tick() * speed) % 1
    return Color3.fromHSV(h, 0.85, 1)
end

local function NewText()
    local t = Drawing.new("Text")
    t.Font = Drawing.Fonts.Plex
    t.Size = 14
    t.Outline = true
    t.Color = Color3.fromRGB(235, 235, 240)
    t.Visible = true
    return t
end

local function NewSquare()
    local s = Drawing.new("Square")
    s.Filled = true
    s.Visible = true
    return s
end

-- Style
local UI_BG = Color3.fromRGB(14, 14, 18)
local UI_TEXT = Color3.fromRGB(235, 235, 240)

-- =========================
-- Notifications
-- =========================
VisualUI.Notifs = {
    items = {},
    queue = {},
    maxVisible = 5,
    width = 280,
    height = 36,
    padding = 6,
    life = 3
}

local notifColors = {
    info = Color3.fromRGB(120, 190, 255),
    success = Color3.fromRGB(120, 255, 170),
    warning = Color3.fromRGB(255, 200, 80)
}

function VisualUI:Notify(text, nType)
    nType = nType or "info"
    table.insert(self.Notifs.queue, {
        text = text,
        type = nType,
        time = tick()
    })
end

local function CreateNotif(data)
    local bg = NewSquare()
    bg.Color = UI_BG
    bg.Transparency = 0.15
    bg.Size = Vector2.new(VisualUI.Notifs.width, VisualUI.Notifs.height)

    local bar = NewSquare()
    bar.Color = notifColors[data.type] or Settings.HUDColor
    bar.Transparency = 0
    bar.Size = Vector2.new(4, VisualUI.Notifs.height)

    local icon = NewSquare()
    icon.Size = Vector2.new(8, 8)
    icon.Color = notifColors[data.type] or Settings.HUDColor
    icon.Transparency = 0

    local txt = NewText()
    txt.Text = data.text
    txt.Size = 14
    txt.Color = UI_TEXT

    return {
        bg = bg,
        bar = bar,
        icon = icon,
        txt = txt,
        start = tick(),
        alpha = 0,
        pos = Vector2.new(0, 0),
        data = data
    }
end

-- =========================
-- ArrayList
-- =========================
VisualUI.Array = {
    byName = {},
    ordered = {},
    width = 200,
    rowHeight = 22,
    padding = 4,
    slideOffset = 26
}

local function BuildArray(modList)
    table.sort(modList, function(a, b) return #a > #b end)
    local active = {}

    for _, name in ipairs(modList) do
        active[name] = true
        local item = VisualUI.Array.byName[name]
        if not item then
            local bg = NewSquare()
            bg.Color = UI_BG
            bg.Transparency = 0.2
            bg.Size = Vector2.new(VisualUI.Array.width, VisualUI.Array.rowHeight)

            local txt = NewText()
            txt.Text = name
            txt.Size = 14
            txt.Color = UI_TEXT

            local bar = NewSquare()
            bar.Color = Settings.HUDColor
            bar.Size = Vector2.new(3, VisualUI.Array.rowHeight)

            item = {
                name = name,
                bg = bg,
                txt = txt,
                bar = bar,
                alpha = 0,
                targetAlpha = 1,
                x = 0
            }
            VisualUI.Array.byName[name] = item
        else
            item.targetAlpha = 1
            item.txt.Text = name
        end
    end

    for name, item in pairs(VisualUI.Array.byName) do
        if not active[name] then
            item.targetAlpha = 0
        end
    end

    VisualUI.Array.ordered = modList
end

-- =========================
-- HUD
-- =========================
VisualUI.HUD = {
    wm = {},
    health = { value = 1 },
    stats = {}
}

local function BuildHUD()
    -- Watermark (fake blur via stacked layers)
    VisualUI.HUD.wm.blur3 = NewSquare()
    VisualUI.HUD.wm.blur3.Color = UI_BG
    VisualUI.HUD.wm.blur3.Transparency = 0.6

    VisualUI.HUD.wm.blur2 = NewSquare()
    VisualUI.HUD.wm.blur2.Color = UI_BG
    VisualUI.HUD.wm.blur2.Transparency = 0.48

    VisualUI.HUD.wm.blur = NewSquare()
    VisualUI.HUD.wm.blur.Color = UI_BG
    VisualUI.HUD.wm.blur.Transparency = 0.36

    VisualUI.HUD.wm.bg = NewSquare()
    VisualUI.HUD.wm.bg.Color = UI_BG
    VisualUI.HUD.wm.bg.Transparency = 0.15

    VisualUI.HUD.wm.text = NewText()
    VisualUI.HUD.wm.text.Size = 13

    -- Health Bar
    VisualUI.HUD.health.bg = NewSquare()
    VisualUI.HUD.health.bg.Color = UI_BG
    VisualUI.HUD.health.bg.Transparency = 0.2
    VisualUI.HUD.health.bg.Size = Vector2.new(180, 8)

    VisualUI.HUD.health.fill = NewSquare()
    VisualUI.HUD.health.fill.Color = Settings.HUDColor
    VisualUI.HUD.health.fill.Transparency = 0

    -- Stats Panel
    VisualUI.HUD.stats.bg = NewSquare()
    VisualUI.HUD.stats.bg.Color = UI_BG
    VisualUI.HUD.stats.bg.Transparency = 0.2
    VisualUI.HUD.stats.bg.Size = Vector2.new(200, 52)

    VisualUI.HUD.stats.text = NewText()
    VisualUI.HUD.stats.text.Size = 13
end

BuildHUD()

-- =========================
-- Main Loop
-- =========================
local fpsValues = {}
local lastFPS = 60
local lastArrayKey = ""

RunService.RenderStepped:Connect(function(dt)
    -- FPS calc
    table.insert(fpsValues, 1 / dt)
    if #fpsValues > 30 then table.remove(fpsValues, 1) end
    local sum = 0
    for _, v in pairs(fpsValues) do sum = sum + v end
    lastFPS = math.floor(sum / #fpsValues)

    local VP = workspace.CurrentCamera.ViewportSize
    local accent = Settings.HUDColor

    -- Notifications
    if Settings.Notifications then
        while #VisualUI.Notifs.queue > 0 and #VisualUI.Notifs.items < VisualUI.Notifs.maxVisible do
            local data = table.remove(VisualUI.Notifs.queue, 1)
            table.insert(VisualUI.Notifs.items, CreateNotif(data))
        end

        local baseX = VP.X - VisualUI.Notifs.width - 10
        local baseY = VP.Y - 50

        for i = #VisualUI.Notifs.items, 1, -1 do
            local n = VisualUI.Notifs.items[i]
            local t = tick() - n.start
            local alive = t < VisualUI.Notifs.life

            local targetY = baseY - (i - 1) * (VisualUI.Notifs.height + VisualUI.Notifs.padding)

            if alive then
                n.alpha = Lerp(n.alpha, 1, dt * 8)
            else
                n.alpha = Lerp(n.alpha, 0, dt * 8)
                if n.alpha < 0.05 then
                    n.bg:Remove(); n.bar:Remove(); n.icon:Remove(); n.txt:Remove()
                    table.remove(VisualUI.Notifs.items, i)
                    continue
                end
            end

            local slideX = baseX - 30 + (30 * n.alpha)
            local pos = LerpV2(n.pos, Vector2.new(slideX, targetY), dt * 8)
            n.pos = pos

            n.bg.Position = pos
            n.bar.Position = pos
            n.icon.Position = pos + Vector2.new(11, 14)
            n.txt.Position = pos + Vector2.new(26, 9)
            n.icon.Color = notifColors[n.data.type] or accent

            n.bg.Transparency = 0.15 + (1 - n.alpha) * 0.6
            n.bar.Transparency = 1 - n.alpha
            n.icon.Transparency = 1 - n.alpha
            n.txt.Transparency = 1 - n.alpha
        end
    else
        for i = #VisualUI.Notifs.items, 1, -1 do
            local n = VisualUI.Notifs.items[i]
            n.bg:Remove(); n.bar:Remove(); n.icon:Remove(); n.txt:Remove()
            table.remove(VisualUI.Notifs.items, i)
        end
    end

    -- ArrayList
    if Settings.HUDArraylist then
        local modules = {}
        if Settings.Enabled then table.insert(modules, "Aimbot") end
        if Settings.SilentAim then table.insert(modules, "Silent Aim") end
        if Settings.Smoothing then table.insert(modules, "Aim Assist") end
        if Settings.TriggerBot then table.insert(modules, "TriggerBot") end
        if Settings.AutoFire then table.insert(modules, "Auto Fire") end
        if Settings.HitboxSink then table.insert(modules, "Hitbox Sink") end
        if Settings.HitboxDesync then table.insert(modules, "Hitbox Desync") end
        if Settings.ChamsEnabled then table.insert(modules, "Chams") end
        if Settings.GlowEnabled then table.insert(modules, "Glow ESP") end
        if Settings.Boxes or Settings.Names or Settings.Tracers then table.insert(modules, "ESP") end
        if Settings.Fullbright then table.insert(modules, "Fullbright") end
        if Settings.BloomEnabled then table.insert(modules, "Bloom") end
        if Settings.TrailEnabled then table.insert(modules, "Trail") end
        if Settings.AuraEnabled then table.insert(modules, "Aura") end
        if Settings.SpeedEnabled then table.insert(modules, "Speed") end
        if Settings.FlyEnabled then table.insert(modules, "Flight") end
        if Settings.NoclipEnabled then table.insert(modules, "Noclip") end
        if Settings.InfJumpEnabled then table.insert(modules, "Infinite Jump") end

        local key = table.concat(modules, "|")
        if key ~= lastArrayKey then
            lastArrayKey = key
            BuildArray(modules)
        end

        local x = VP.X - VisualUI.Array.width - 10
        local y = 20
        local row = 0
        for _, name in ipairs(VisualUI.Array.ordered) do
            local m = VisualUI.Array.byName[name]
            if m then
                m.alpha = Lerp(m.alpha, m.targetAlpha, dt * 10)
                if m.alpha > 0.02 then
                    row = row + 1
                    local rowY = y + (row - 1) * (VisualUI.Array.rowHeight + VisualUI.Array.padding)
                    local targetX = x + (1 - m.alpha) * VisualUI.Array.slideOffset
                    m.x = Lerp(m.x, targetX, dt * 12)

                    local rowPos = Vector2.new(m.x, rowY)
                    m.bg.Position = rowPos
                    m.txt.Position = rowPos + Vector2.new(6, 3)
                    m.bar.Position = rowPos + Vector2.new(VisualUI.Array.width - 3, 0)

                    local hueOffset = ((tick() * 0.18) + (row * 0.06)) % 1
                    local grad = Color3.fromHSV(hueOffset, 0.85, 1)
                    m.bar.Color = grad

                    m.bg.Transparency = 0.2 + (1 - m.alpha) * 0.65
                    m.txt.Transparency = 1 - m.alpha
                    m.bar.Transparency = 1 - m.alpha
                    m.bg.Visible = true
                    m.txt.Visible = true
                    m.bar.Visible = true
                else
                    m.bg.Visible = false
                    m.txt.Visible = false
                    m.bar.Visible = false
                end
            end
        end

        for name, m in pairs(VisualUI.Array.byName) do
            if m.targetAlpha == 0 then
                m.alpha = Lerp(m.alpha, 0, dt * 8)
                if m.alpha <= 0.01 then
                    m.bg:Remove()
                    m.txt:Remove()
                    m.bar:Remove()
                    VisualUI.Array.byName[name] = nil
                end
            end
        end
    else
        for _, item in pairs(VisualUI.Array.byName) do
            item.targetAlpha = 0
            item.bg.Visible = false
            item.txt.Visible = false
            item.bar.Visible = false
        end
    end

    -- HUD Core
    if not Settings.HUDEnabled then
        VisualUI.HUD.wm.blur3.Visible = false
        VisualUI.HUD.wm.blur2.Visible = false
        VisualUI.HUD.wm.blur.Visible = false
        VisualUI.HUD.wm.bg.Visible = false
        VisualUI.HUD.wm.text.Visible = false
        VisualUI.HUD.health.bg.Visible = false
        VisualUI.HUD.health.fill.Visible = false
        VisualUI.HUD.stats.bg.Visible = false
        VisualUI.HUD.stats.text.Visible = false
        return
    end

    -- Watermark
    if Settings.HUDWatermark then
        local ping = "-"
        pcall(function()
            local stats = game:GetService("Stats")
            if stats.Network:FindFirstChild("ServerStatsItem") then
                ping = math.floor(stats.Network.ServerStatsItem["Data Ping"]:GetValue())
            end
        end)

        local wmText = string.format("FlickSpeed | %d FPS | %s ms", lastFPS, tostring(ping))
        VisualUI.HUD.wm.text.Text = wmText

        local bounds = VisualUI.HUD.wm.text.TextBounds
        local padX, padY = 10, 6

        VisualUI.HUD.wm.blur3.Size = Vector2.new(bounds.X + padX * 2 + 10, bounds.Y + padY * 2 + 10)
        VisualUI.HUD.wm.blur3.Position = Vector2.new(12, 12)

        VisualUI.HUD.wm.blur2.Size = Vector2.new(bounds.X + padX * 2 + 6, bounds.Y + padY * 2 + 6)
        VisualUI.HUD.wm.blur2.Position = Vector2.new(14, 14)

        VisualUI.HUD.wm.blur.Size = Vector2.new(bounds.X + padX * 2 + 3, bounds.Y + padY * 2 + 3)
        VisualUI.HUD.wm.blur.Position = Vector2.new(15, 15)

        VisualUI.HUD.wm.bg.Size = Vector2.new(bounds.X + padX * 2, bounds.Y + padY * 2)
        VisualUI.HUD.wm.bg.Position = Vector2.new(16, 16)

        VisualUI.HUD.wm.text.Position = Vector2.new(16 + padX, 16 + padY)

        VisualUI.HUD.wm.blur3.Visible = true
        VisualUI.HUD.wm.blur2.Visible = true
        VisualUI.HUD.wm.bg.Visible = true
        VisualUI.HUD.wm.blur.Visible = true
        VisualUI.HUD.wm.text.Visible = true
    else
        VisualUI.HUD.wm.blur3.Visible = false
        VisualUI.HUD.wm.blur2.Visible = false
        VisualUI.HUD.wm.bg.Visible = false
        VisualUI.HUD.wm.blur.Visible = false
        VisualUI.HUD.wm.text.Visible = false
    end

    -- Health Bar (animated)
    if Settings.HUDHealth then
        local char = Player.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        local hp = (hum and hum.Health / hum.MaxHealth) or 1
        VisualUI.HUD.health.value = Lerp(VisualUI.HUD.health.value, hp, dt * 6)

        local hbPos = Vector2.new(16, VP.Y - 30)
        VisualUI.HUD.health.bg.Position = hbPos
        VisualUI.HUD.health.fill.Position = hbPos
        VisualUI.HUD.health.fill.Size = Vector2.new(180 * VisualUI.HUD.health.value, 8)
        VisualUI.HUD.health.fill.Color = accent

        VisualUI.HUD.health.bg.Visible = true
        VisualUI.HUD.health.fill.Visible = true
    else
        VisualUI.HUD.health.bg.Visible = false
        VisualUI.HUD.health.fill.Visible = false
    end

    -- Stats Panel
    if Settings.HUDSpeed or Settings.HUDCoords or Settings.HUDPlayers then
        local char = Player.Character
        local hum = char and char:FindFirstChildOfClass("Humanoid")
        local root = char and char:FindFirstChild("HumanoidRootPart")
        local spd = hum and hum.WalkSpeed or 0
        local coords = root and root.Position or Vector3.new()
        local players = #Players:GetPlayers()

        local lines = {}
        if Settings.HUDSpeed then table.insert(lines, string.format("Speed: %d", spd)) end
        if Settings.HUDCoords then table.insert(lines, string.format("XYZ: %d %d %d", coords.X, coords.Y, coords.Z)) end
        if Settings.HUDPlayers then table.insert(lines, string.format("Players: %d", players)) end

        VisualUI.HUD.stats.text.Text = table.concat(lines, "\n")

        VisualUI.HUD.stats.bg.Position = Vector2.new(16, VP.Y - 95)
        VisualUI.HUD.stats.text.Position = Vector2.new(22, VP.Y - 90)

        VisualUI.HUD.stats.bg.Visible = true
        VisualUI.HUD.stats.text.Visible = true
    else
        VisualUI.HUD.stats.bg.Visible = false
        VisualUI.HUD.stats.text.Visible = false
    end
end)

-- Example notification (remove if not needed)
-- VisualUI:Notify("Loaded visual systems", "success")

Window:Init()
if ConfigLoaded then
    SyncUI()
end
print("[FlickSpeed v3.5] Loaded! | Velocity 0.8.0 | HUD + FX")

Features & Information

uh script made by claude sonnet/opus 4.6 gemini 3/3.1 gpt codex 3/2 made this just 4 fun maybe many crashes but i like it if u want u can take this

Community Comments (1)

smertni*qqsmertni*qqMar 18, 2026

hope you enjoy

More Scripts for Universal Scripts