--!nocheck --[[ Guerra Fria — Hub Base + ESP Completo (PlaceId 13687899540 / placeVersion 8617) Renderizacao via ScreenGui nativo (IgnoreGuiInset = true) + Highlight (Chams), evitando dependencia do overlay Drawing externo. Regra de seguranca (ParticleScaler): NUNCA acessar/instanciar VirtualUser, VirtualInputManager, LinkingService, ProcessInstancePhysicsService, SafetyService, AppUpdateService, RuntimeScriptService, AccountService, DataModelPatchService, OmniRecommendationsService, SpawnService, OpenCloudService ou UGCValidationService. ]] local cloneref = cloneref or clonereference or function(inst) return inst end local Players = cloneref(game:GetService("Players")) local Workspace = cloneref(game:GetService("Workspace")) local RunService = cloneref(game:GetService("RunService")) local Teams = cloneref(game:GetService("Teams")) local UserInputService = cloneref(game:GetService("UserInputService")) local HttpService = cloneref(game:GetService("HttpService")) local CoreGui = cloneref(game:GetService("CoreGui")) local ReplicatedStorage = cloneref(game:GetService("ReplicatedStorage")) local Lighting = cloneref(game:GetService("Lighting")) local LocalPlayer = Players.LocalPlayer local HasLiveState = type(STATE) == "table" and type(STATE.onCleanup) == "function" local Unloaded = false local Connections = {} local EspGui = nil local ChamsFolder = nil local Trails3DFolder = nil local Window = nil local VisualState = { MenuModalBtn = nil, MenuWasOpen = false, SavedMouseBehavior = nil, SavedMouseIconEnabled = nil, OrigEnvSaved = false, OrigEnv = {}, OrigAtmos = setmetatable({}, { __mode = "k" }), OrigCameraFov = nil, FovModified = false, TimeModified = false, FogModified = false, BrightModified = false, OrigParts = setmetatable({}, { __mode = "k" }), OrigClothes = setmetatable({}, { __mode = "k" }), DetachedSurfaces = {}, LastVisualSync = 0, } local restoreAllVisuals = nil local ShotDebugMod = nil local OrigShotDebugStep = nil local OrigShotDebugImpact = nil local RecoilControllerMod = nil local OrigRecoilScaleFn = nil local OrigRecoilKickFn = nil local HipAimMod = nil local OrigHipAimKickFn = nil local BreathingMod = nil local OrigBreathingSwayFn = nil local ClientFireMod = nil local OrigClientFireBatch = nil local CollisionGroupsMod = nil local ArmingMod = nil local KeybindSilent = nil local KeybindBoost = nil local TEAM_RAY_GROUPS = { NATO = "RayNATO", PACT = "RayPACT", } local CachedArmingExclusions = {} local SilentVisCache = setmetatable({}, { __mode = "k" }) local SavedThreadId = (type(getthreadidentity) == "function") and getthreadidentity() or nil local function restoreCapability() if SavedThreadId and type(setthreadidentity) == "function" and type(getthreadidentity) == "function" then if getthreadidentity() ~= SavedThreadId then pcall(setthreadidentity, SavedThreadId) end end end local function resolveTeamRayGroup(teamName) return TEAM_RAY_GROUPS[teamName] or "RayNeutral" end local function isFiniteNum(n) return type(n) == "number" and n == n and math.abs(n) < 1e9 end local function isFiniteVec3(v) return typeof(v) == "Vector3" and isFiniteNum(v.X) and isFiniteNum(v.Y) and isFiniteNum(v.Z) end local EngineMod = nil local OrigEngineUpdate = nil local WheelDriveMod = nil local OrigWheelDriveUpdate = nil local TrackDriveMod = nil local OrigTrackDriveUpdate = nil local TurretCtrlMod = nil local OrigTurretAttach = nil local OrigTurretApplyRecoil = nil local OrigEngineCfgs = setmetatable({}, { __mode = "k" }) local OrigEngineStates = setmetatable({}, { __mode = "k" }) local OrigWheelStates = setmetatable({}, { __mode = "k" }) local OrigTrackStates = setmetatable({}, { __mode = "k" }) local OrigTurretCfgs = setmetatable({}, { __mode = "k" }) local SilentKeyHeld = false local VehBoostKeyHeld = false local CurrentDrivenRoot = nil local CurrentDrivenDrive = nil local LastActiveVehicleDriveAt = 0 local function registerCleanup(fn) if HasLiveState then STATE.onCleanup(fn) end end local function connectSignal(signal, fn) if HasLiveState and type(STATE.connect) == "function" then return STATE.connect(signal, fn) end local conn = signal:Connect(fn) table.insert(Connections, conn) return conn end local function isAlive() if Unloaded then return false end if HasLiveState and type(STATE.alive) == "function" then return STATE.alive() end return true end local function getSafeUiParent() if type(gethui) == "function" then local ok, ui = pcall(gethui) if ok and ui then return ui end end return CoreGui end -- Limpeza global garantida no reload ou Unload local function runFullCleanup() if Unloaded then return end Unloaded = true for i = #Connections, 1, -1 do local c = Connections[i] Connections[i] = nil pcall(function() c:Disconnect() end) end if EspGui then pcall(function() EspGui:Destroy() end) EspGui = nil end if ChamsFolder then pcall(function() ChamsFolder:Destroy() end) ChamsFolder = nil end if Trails3DFolder then pcall(function() Trails3DFolder:Destroy() end) Trails3DFolder = nil end if ShotDebugMod then if OrigShotDebugStep then pcall(function() ShotDebugMod.onStep = OrigShotDebugStep end) end if OrigShotDebugImpact then pcall(function() ShotDebugMod.onImpact = OrigShotDebugImpact end) end OrigShotDebugStep = nil OrigShotDebugImpact = nil ShotDebugMod = nil end if RecoilControllerMod then if OrigRecoilScaleFn then pcall(function() RecoilControllerMod.layLD9LwlI = OrigRecoilScaleFn end) end if OrigRecoilKickFn then pcall(function() RecoilControllerMod.rNDvKCHx7N = OrigRecoilKickFn end) end OrigRecoilScaleFn = nil OrigRecoilKickFn = nil RecoilControllerMod = nil end if HipAimMod then if OrigHipAimKickFn then pcall(function() HipAimMod.kick = OrigHipAimKickFn end) end OrigHipAimKickFn = nil HipAimMod = nil end if BreathingMod then if OrigBreathingSwayFn then pcall(function() BreathingMod.getSway = OrigBreathingSwayFn end) end OrigBreathingSwayFn = nil BreathingMod = nil end if ClientFireMod then if OrigClientFireBatch then pcall(function() ClientFireMod.sLnpiWe6Dt = OrigClientFireBatch end) end OrigClientFireBatch = nil ClientFireMod = nil end for cfg, orig in pairs(OrigEngineCfgs) do pcall(function() cfg.HorsepowerLimit = orig.HorsepowerLimit cfg.RedlineRPM = orig.RedlineRPM cfg.ShiftRPM = orig.ShiftRPM cfg.DirectionShiftTime = orig.DirectionShiftTime end) end for eng, orig in pairs(OrigEngineStates) do pcall(function() eng.torqueScale = orig.torqueScale end) end for drv, orig in pairs(OrigWheelStates) do pcall(function() drv.topSpeed = orig.topSpeed drv.dragK = orig.dragK drv.maxSteer = orig.maxSteer drv.steerSpeed = orig.steerSpeed drv.steerReduction = orig.steerReduction if drv.wheelParams then drv.wheelParams.Grip = orig.Grip drv.wheelParams.PeakGrip = orig.PeakGrip drv.wheelParams.SlideGrip = orig.SlideGrip drv.wheelParams.DriftGrip = orig.DriftGrip drv.wheelParams.BrakeMultiplier = orig.BrakeMultiplier drv.wheelParams.HandBrakeMultiplier = orig.HandBrakeMultiplier end end) end for drv, orig in pairs(OrigTrackStates) do pcall(function() drv.topSpeed = orig.topSpeed drv.dragK = orig.dragK drv.mu = orig.mu drv.latMu = orig.latMu drv.latGrip = orig.latGrip drv.turnRate = orig.turnRate drv.highSpeedShare = orig.highSpeedShare drv.steerGain = orig.steerGain drv.brakeDecel = orig.brakeDecel drv.neutralSteer = orig.neutralSteer drv.pivotThrottle = orig.pivotThrottle end) end for tcfg, orig in pairs(OrigTurretCfgs) do pcall(function() tcfg.YawSpeed = orig.YawSpeed tcfg.PitchSpeed = orig.PitchSpeed end) end if EngineMod and OrigEngineUpdate then pcall(function() EngineMod.Update = OrigEngineUpdate end) end if WheelDriveMod and OrigWheelDriveUpdate then pcall(function() WheelDriveMod.Update = OrigWheelDriveUpdate end) end if TrackDriveMod and OrigTrackDriveUpdate then pcall(function() TrackDriveMod.Update = OrigTrackDriveUpdate end) end if TurretCtrlMod then if OrigTurretAttach then pcall(function() TurretCtrlMod.Attach = OrigTurretAttach end) end if OrigTurretApplyRecoil then pcall(function() TurretCtrlMod.ApplyRecoil = OrigTurretApplyRecoil end) end end EngineMod, OrigEngineUpdate = nil, nil WheelDriveMod, OrigWheelDriveUpdate = nil, nil TrackDriveMod, OrigTrackDriveUpdate = nil, nil TurretCtrlMod, OrigTurretAttach, OrigTurretApplyRecoil = nil, nil, nil CurrentDrivenRoot, CurrentDrivenDrive = nil, nil if type(restoreAllVisuals) == "function" then pcall(restoreAllVisuals) end if Window then pcall(function() Window:Destroy() end) Window = nil end if type(getgenv) == "function" then getgenv().__GF_ESP_STATS = nil if getgenv().__GF_ESP_CLEANUP == runFullCleanup then getgenv().__GF_ESP_CLEANUP = nil end end end if type(getgenv) == "function" then if type(getgenv().__GF_ESP_CLEANUP) == "function" then pcall(getgenv().__GF_ESP_CLEANUP) end getgenv().__GF_ESP_CLEANUP = runFullCleanup end registerCleanup(function() runFullCleanup() end) -- Carregar WindUI local WindUI = loadstring(game:HttpGet("https://github.com/Footagesus/WindUI/releases/latest/download/main.lua"))() -- Configuracao central do ESP local ConfigPath = "GuerraFria_ESP_Config.json" local Config = { Enabled = true, ShowEnemies = true, ShowAllies = false, ShowNeutral = false, IgnoreUnconscious = false, UseVisibilityCheck = false, MaxDistance = 1200, DistanceUnit = "Meters", -- "Meters" (studs * 0.28) ou "Studs" -- Cores e Deteccao de Time ColorMode = "Enemy / Ally", -- "Enemy / Ally" (Inimigo=Vermelho, Aliado=Azul) ou "Team Color (Auto)" HighlightUnconsciousColor = true, EnemyVisibleColor = Color3.fromRGB(255, 65, 65), EnemyOccludedColor = Color3.fromRGB(255, 165, 40), AllyColor = Color3.fromRGB(65, 175, 255), NeutralColor = Color3.fromRGB(220, 220, 220), UnconsciousColor = Color3.fromRGB(255, 220, 50), -- Box BoxMode = "Corners", -- "Off", "2D Full", "Corners" BoxThickness = 2, BoxTransparency = 1, -- 1 = opaco, 0 = invisivel BoxOutline = true, BoxFill = false, BoxFillTransparency = 0.2, BoxUseCustomColor = false, BoxCustomColor = Color3.fromRGB(255, 255, 255), -- Skeleton R6 SkeletonEnabled = true, SkeletonThickness = 1.5, SkeletonTransparency = 1, SkeletonUseCustomColor = false, SkeletonCustomColor = Color3.fromRGB(255, 255, 255), -- Barra de Vida (Limb Health real) & Shock HealthBarEnabled = true, HealthMode = "Torso", -- "Torso", "Limbs Total", "Vital (Head+Torso)" HealthBarWidth = 3, HealthTextEnabled = true, ShockBarEnabled = false, HealthFullColor = Color3.fromRGB(80, 235, 110), HealthMidColor = Color3.fromRGB(255, 200, 40), HealthLowColor = Color3.fromRGB(255, 55, 55), ShockColor = Color3.fromRGB(70, 200, 255), -- Textos NameEnabled = true, TeamTagEnabled = true, UseDisplayName = false, DistanceEnabled = true, WeaponEnabled = true, ClassEnabled = true, StanceEnabled = true, TextSize = 13, TextFont = "Code", -- "Code", "Gotham", "SourceSans", "RobotoMono" TextOutline = true, TextTransparency = 1, TextUseCustomColor = false, TextCustomColor = Color3.fromRGB(255, 255, 255), -- Tracers TracerEnabled = false, TracerOrigin = "Bottom", -- "Bottom", "Center", "Top", "Mouse" TracerTarget = "Feet", -- "Feet", "Center", "Head" TracerThickness = 1.2, TracerTransparency = 0.85, TracerUseCustomColor = false, TracerCustomColor = Color3.fromRGB(255, 80, 80), -- Chams (Highlight, limite de 28 mais proximos) ChamsEnabled = false, ChamsDepthMode = "AlwaysOnTop", -- "AlwaysOnTop", "Occluded" ChamsFillTransparency = 0.65, ChamsOutlineTransparency = 0.15, ChamsUseCustomColor = false, ChamsFillColor = Color3.fromRGB(255, 65, 65), ChamsOutlineColor = Color3.fromRGB(255, 255, 255), -- Vehicle ESP (somente modelos com VehicleNetId) VehicleEspEnabled = true, VehicleFilter = "All", -- "All", "Enemy Only", "Ally Only" VehicleMaxDistance = 1500, VehicleUseTeamColor = true, VehicleColor = Color3.fromRGB(255, 195, 70), -- Balistica / Trajetoria da Bala BulletTrailEnabled = true, BulletTrail3D = true, BulletTrailDuration = 2.5, BulletTrailThickness = 2.0, BulletTrailColor = Color3.fromRGB(255, 225, 75), BulletImpactMarker = true, BulletImpactColor = Color3.fromRGB(255, 75, 75), BulletImpactHitColor = Color3.fromRGB(80, 255, 120), BulletPreviewEnabled = false, BulletPreviewOnlyADS = true, BulletPreviewThickness = 1.6, BulletPreviewColor = Color3.fromRGB(90, 220, 255), BulletPreviewTargetColor = Color3.fromRGB(255, 85, 85), -- Modificacao de Arma (Recoil & Estabilidade) NoRecoil = false, RecoilPercent = 100, NoBreathSway = false, BreathSwayPercent = 100, -- Silent Aim SilentAimEnabled = false, SilentAimKey = "U", SilentAimKeyMode = "Toggle", -- "Toggle", "Hold", "Always On" SilentAimShowFov = true, SilentAimFovRadius = 150, SilentAimMaxAngle = 22, SilentAimFovColor = Color3.fromRGB(255, 255, 255), SilentAimShowTarget = true, SilentAimTargetPart = "Head", -- "Head", "Torso", "Nearest Part", "Random" SilentAimHitChance = 100, SilentAimMaxDistance = 800, SilentAimVisibleOnly = true, SilentAimIgnoreUnconscious = true, SilentAimDropComp = true, SilentAimPrediction = true, SilentAimVehicles = true, -- Modificacoes de Veiculos (dentro dos limites do jogo) VehModEnabled = false, VehTopSpeedMult = 1.4, VehNoDrag = false, VehTorqueMult = 1.6, VehUnlimitedHP = false, VehInstantShift = true, VehGripMult = 1.5, VehSteerMult = 1.3, VehStrongBrakes = false, VehNeutralSteer = false, VehBoostEnabled = false, VehBoostKey = "LeftShift", VehBoostMult = 1.5, VehSpeedLimitEnabled = false, VehSpeedLimit = 80, VehAntiFlip = false, TurretSpeedMult = 1.0, TurretNoRecoil = false, -- Visuals VisualTimeEnabled = false, VisualTimePreset = "Day", -- "Day", "Night", "Sunset", "Dawn", "Custom" VisualClockTime = 14, VisualNoFog = false, VisualFullBright = false, VisualFovEnabled = false, VisualFov = 85, VisualCharEnabled = false, VisualCharColor = Color3.fromRGB(115, 200, 255), VisualCharMaterial = "ForceField", VisualCharHideClothes = true, VisualWeaponEnabled = false, VisualWeaponColor = Color3.fromRGB(255, 95, 95), VisualWeaponMaterial = "ForceField", VisualArmsEnabled = false, VisualArmsColor = Color3.fromRGB(115, 200, 255), VisualArmsMaterial = "ForceField", -- UI MenuKey = "Insert", } local FontMap = { Code = Enum.Font.Code, Gotham = Enum.Font.GothamMedium, SourceSans = Enum.Font.SourceSansBold, RobotoMono = Enum.Font.RobotoMono, } -- Registro de widgets para sincronizacao de config local WidgetRegistry = {} local function registerWidget(key, kind, obj) WidgetRegistry[key] = { kind = kind, obj = obj } end local function tableToColor(t, fallback) if type(t) == "table" and type(t.r) == "number" and type(t.g) == "number" and type(t.b) == "number" then return Color3.fromRGB(t.r, t.g, t.b) end return fallback end local function serializeConfig() local out = {} for k, v in pairs(Config) do if typeof(v) == "Color3" then out[k] = { __color3 = true, r = math.round(v.R * 255), g = math.round(v.G * 255), b = math.round(v.B * 255) } else out[k] = v end end return HttpService:JSONEncode(out) end local function applyConfigFromJson(raw) local ok, decoded = pcall(function() return HttpService:JSONDecode(raw) end) if not ok or type(decoded) ~= "table" then return false, "Invalid JSON" end for k, v in pairs(decoded) do if Config[k] ~= nil then if type(v) == "table" and v.__color3 then Config[k] = tableToColor(v, Config[k]) elseif typeof(Config[k]) == typeof(v) then Config[k] = v end end end for k, entry in pairs(WidgetRegistry) do local val = Config[k] if val ~= nil and entry.obj then pcall(function() if entry.kind == "Toggle" or entry.kind == "Slider" then entry.obj:Set(val) elseif entry.kind == "Dropdown" then entry.obj:Select(val) elseif entry.kind == "Colorpicker" then entry.obj:Set(val) elseif entry.kind == "Keybind" then entry.obj:Set(val) end end) end end if Window and Config.MenuKey and Enum.KeyCode[Config.MenuKey] then pcall(function() Window:SetToggleKey(Enum.KeyCode[Config.MenuKey]) end) end VisualState.Dirty = true return true end -- Criacao da camada ScreenGui do ESP (alinhamento 1:1 com WorldToViewportPoint) local UiParent = getSafeUiParent() EspGui = Instance.new("ScreenGui") EspGui.Name = "GF_ESP_Overlay" EspGui.IgnoreGuiInset = true EspGui.ResetOnSpawn = false EspGui.DisplayOrder = 0 EspGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling EspGui.Parent = UiParent ChamsFolder = Instance.new("Folder") ChamsFolder.Name = "GF_Chams" ChamsFolder.Parent = UiParent Trails3DFolder = Instance.new("Folder") Trails3DFolder.Name = "GF_BulletTrails3D" Trails3DFolder.Parent = Workspace:FindFirstChild("Ignore") or Workspace -- Helpers de criacao de GUI local function newLineFrame(parent, zindex) local f = Instance.new("Frame") f.AnchorPoint = Vector2.new(0.5, 0.5) f.BorderSizePixel = 0 f.Visible = false f.ZIndex = zindex or 2 f.Parent = parent return f end local function newRectFrame(parent, zindex) local f = Instance.new("Frame") f.BorderSizePixel = 0 f.Visible = false f.ZIndex = zindex or 2 f.Parent = parent return f end local function newTextLabel(parent, zindex) local t = Instance.new("TextLabel") t.BackgroundTransparency = 1 t.AnchorPoint = Vector2.new(0.5, 0) t.Size = UDim2.fromOffset(280, 22) t.TextColor3 = Color3.new(1, 1, 1) t.TextStrokeColor3 = Color3.new(0, 0, 0) t.TextStrokeTransparency = 0 t.TextXAlignment = Enum.TextXAlignment.Center t.TextYAlignment = Enum.TextYAlignment.Top t.Visible = false t.ZIndex = zindex or 3 t.Parent = parent return t end local function drawLine2D(frame, p1, p2, color, thickness, opacity) local dx = p2.X - p1.X local dy = p2.Y - p1.Y local len = math.sqrt(dx * dx + dy * dy) if len < 0.5 then frame.Visible = false return end frame.Position = UDim2.fromOffset((p1.X + p2.X) * 0.5, (p1.Y + p2.Y) * 0.5) frame.Size = UDim2.fromOffset(len, math.max(thickness, 1)) frame.Rotation = math.deg(math.atan2(dy, dx)) frame.BackgroundColor3 = color frame.BackgroundTransparency = 1 - math.clamp(opacity, 0, 1) frame.Visible = true end local function clipAndProjectSegment(camera, p0, p1) local camCF = camera.CFrame local invCF = camCF:Inverse() -- No espaco da camera do Roblox, frente eh -Z local c0 = invCF * p0 local c1 = invCF * p1 local nearZ = -0.25 if c0.Z > nearZ and c1.Z > nearZ then return nil, nil end if c0.Z > nearZ then local t = (nearZ - c0.Z) / (c1.Z - c0.Z) c0 = c0:Lerp(c1, t) p0 = camCF * c0 elseif c1.Z > nearZ then local t = (nearZ - c1.Z) / (c0.Z - c1.Z) c1 = c1:Lerp(c0, t) p1 = camCF * c1 end local v0 = camera:WorldToViewportPoint(p0) local v1 = camera:WorldToViewportPoint(p1) if v0.Z <= 0 or v1.Z <= 0 then return nil, nil end return Vector2.new(v0.X, v0.Y), Vector2.new(v1.X, v1.Y) end -- Helpers de jogo (Guerra Fria) local LIMB_NAMES = { "Head", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg" } local SKELETON_CONNS_COUNT = 8 local BOX_CORNER_LINES = 8 local BOX_3D_EDGES_COUNT = 12 local BOX_3D_EDGE_PAIRS = { { 1, 2 }, { 2, 3 }, { 3, 4 }, { 4, 1 }, -- base inferior { 5, 6 }, { 6, 7 }, { 7, 8 }, { 8, 5 }, -- topo { 1, 5 }, { 2, 6 }, { 3, 7 }, { 4, 8 }, -- pilares } local MAX_ACTIVE_CHAMS = 28 local PlayerCache = {} -- [Model] = entry local VehicleCache = {} -- [Model] = entry local VisRayParams = RaycastParams.new() VisRayParams.FilterType = Enum.RaycastFilterType.Exclude VisRayParams.IgnoreWater = true local function resolvePlayerForCharacter(model) local plr = Players:FindFirstChild(model.Name) if plr and plr:IsA("Player") then return plr end local ok, found = pcall(Players.GetPlayerFromCharacter, Players, model) if ok and found then return found end return nil end local function refreshCharacterParts(entry) local model = entry.Model entry.Head = model:FindFirstChild("Head") entry.Torso = model:FindFirstChild("Torso") entry.LeftArm = model:FindFirstChild("Left Arm") entry.RightArm = model:FindFirstChild("Right Arm") entry.LeftLeg = model:FindFirstChild("Left Leg") entry.RightLeg = model:FindFirstChild("Right Leg") entry.RootPart = model:FindFirstChild("HumanoidRootPart") or model.PrimaryPart entry.Humanoid = model:FindFirstChildOfClass("Humanoid") local cv = model:FindFirstChild("CharacterValues") entry.CharacterValues = cv if cv then entry.Unconscious = cv:FindFirstChild("Unconscious") entry.Shock = cv:FindFirstChild("Shock") entry.Stance = cv:FindFirstChild("Stance") entry.ClassType = cv:FindFirstChild("ClassType") else entry.Unconscious = nil entry.Shock = nil entry.Stance = nil entry.ClassType = nil end entry.Limbs = { Head = entry.Head, Torso = entry.Torso, ["Left Arm"] = entry.LeftArm, ["Right Arm"] = entry.RightArm, ["Left Leg"] = entry.LeftLeg, ["Right Leg"] = entry.RightLeg, } entry.LimbHealth = {} for _, name in ipairs(LIMB_NAMES) do local part = entry.Limbs[name] local h = part and part:FindFirstChild("Health") if h and h:IsA("NumberValue") then entry.LimbHealth[name] = h end end local tool = model:FindFirstChildWhichIsA("Tool") entry.WeaponName = tool and tool.Name or nil end local function isEntryDead(entry) local model = entry and entry.Model if not model or not model.Parent or not model:IsDescendantOf(Workspace) then return true end if model:GetAttribute("CorpseId") ~= nil or model:GetAttribute("Dead") == true or model:GetAttribute("CorpseTeam") ~= nil then return true end if model.Name:sub(-7) == "_Corpse" then return true end local hum = entry.Humanoid if hum then if hum.Health <= 0 or hum:GetState() == Enum.HumanoidStateType.Dead then return true end end local hh = entry.LimbHealth and entry.LimbHealth.Head if hh and hh.Value <= 0 then return true end local th = entry.LimbHealth and entry.LimbHealth.Torso if th and th.Value <= 0 then return true end return false end local function getCharacterHealth(entry) if isEntryDead(entry) then local hum = entry and entry.Humanoid local maxH = (hum and hum.MaxHealth > 0) and hum.MaxHealth or 150 return 0, maxH end local mode = Config.HealthMode if mode == "Torso" then local h = entry.LimbHealth.Torso if h then local maxH = h:GetAttribute("MaxHealth") or 150 return math.clamp(h.Value, 0, maxH), maxH end elseif mode == "Vital (Head+Torso)" then local hh = entry.LimbHealth.Head local th = entry.LimbHealth.Torso if hh and th then local hMax = hh:GetAttribute("MaxHealth") or 50 local tMax = th:GetAttribute("MaxHealth") or 150 if hh.Value <= 0 or th.Value <= 0 then return 0, hMax + tMax end return math.clamp(hh.Value + th.Value, 0, hMax + tMax), hMax + tMax end elseif mode == "Limbs Total" then local cur, maxSum, any = 0, 0, false for _, name in ipairs(LIMB_NAMES) do local h = entry.LimbHealth[name] if h then any = true local m = h:GetAttribute("MaxHealth") or 100 cur += math.clamp(h.Value, 0, m) maxSum += m end end if any and maxSum > 0 then return cur, maxSum end end local th = entry.LimbHealth.Torso if th then local maxH = th:GetAttribute("MaxHealth") or 150 return math.clamp(th.Value, 0, maxH), maxH end local hum = entry.Humanoid if hum and hum.MaxHealth > 0 then return math.clamp(hum.Health, 0, hum.MaxHealth), hum.MaxHealth end return 100, 100 end local function getEquippedWeaponLabel(entry) if entry.WeaponName and entry.WeaponName ~= "" then return entry.WeaponName end local bodyGuns = entry.Model:GetAttribute("BodyGuns") if type(bodyGuns) == "string" and bodyGuns ~= "" then local first = bodyGuns:match("^([^:]+)") return first or bodyGuns end return "Desarmado" end local function createPlayerVisuals() local container = Instance.new("Folder") container.Name = "P" container.Parent = EspGui local v = { Container = container } -- 2D Box Outline + Main + Fill v.BoxOutlineFrame = newRectFrame(container, 1) v.BoxOutlineFrame.BackgroundTransparency = 1 v.BoxOutlineStroke = Instance.new("UIStroke") v.BoxOutlineStroke.Color = Color3.new(0, 0, 0) v.BoxOutlineStroke.Thickness = 3 v.BoxOutlineStroke.Parent = v.BoxOutlineFrame v.BoxFrame = newRectFrame(container, 2) v.BoxFrame.BackgroundTransparency = 1 v.BoxStroke = Instance.new("UIStroke") v.BoxStroke.Color = Color3.new(1, 0, 0) v.BoxStroke.Thickness = 1.5 v.BoxStroke.Parent = v.BoxFrame -- Corner Lines v.CornerOutlines = {} v.Corners = {} for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i] = newLineFrame(container, 1) v.Corners[i] = newLineFrame(container, 2) end -- 3D Box Edges v.Box3DLines = {} for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i] = newLineFrame(container, 2) end -- Skeleton Lines v.Skeleton = {} for i = 1, SKELETON_CONNS_COUNT do v.Skeleton[i] = newLineFrame(container, 2) end -- Health & Shock Bars v.HealthBg = newRectFrame(container, 1) v.HealthBg.BackgroundColor3 = Color3.fromRGB(12, 12, 12) v.HealthBg.BackgroundTransparency = 0.15 v.HealthBar = newRectFrame(container, 2) v.ShockBar = newRectFrame(container, 2) v.HealthText = newTextLabel(container, 3) -- Texts v.TopText = newTextLabel(container, 3) v.BottomText = newTextLabel(container, 3) -- Tracer v.Tracer = newLineFrame(container, 1) -- Highlight (Chams) v.Highlight = Instance.new("Highlight") v.Highlight.Name = "GF_Cham" v.Highlight.Enabled = false v.Highlight.Parent = ChamsFolder return v end local function hidePlayerVisuals(v) v.BoxOutlineFrame.Visible = false v.BoxFrame.Visible = false for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i].Visible = false v.Corners[i].Visible = false end for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end for i = 1, SKELETON_CONNS_COUNT do v.Skeleton[i].Visible = false end v.HealthBg.Visible = false v.HealthBar.Visible = false v.ShockBar.Visible = false v.HealthText.Visible = false v.TopText.Visible = false v.BottomText.Visible = false v.Tracer.Visible = false if v.Highlight.Enabled then v.Highlight.Enabled = false end end local function destroyPlayerEntry(model) local entry = PlayerCache[model] if not entry then return end PlayerCache[model] = nil for _, c in ipairs(entry.Conns) do pcall(function() c:Disconnect() end) end pcall(function() entry.Visuals.Container:Destroy() end) pcall(function() entry.Visuals.Highlight:Destroy() end) end local function trackCharacter(model) if not model:IsA("Model") or PlayerCache[model] then return end local plr = resolvePlayerForCharacter(model) if plr == LocalPlayer or model.Name == LocalPlayer.Name then return end local entry = { Model = model, Player = plr, Conns = {}, Visuals = createPlayerVisuals(), Limbs = {}, LimbHealth = {}, LastVisible = false, LastVisCheck = 0, } entry.Visuals.Highlight.Adornee = model refreshCharacterParts(entry) table.insert(entry.Conns, model.ChildAdded:Connect(function(child) if child:IsA("Tool") or child.Name == "CharacterValues" or child:IsA("BasePart") then task.defer(refreshCharacterParts, entry) end end)) table.insert(entry.Conns, model.ChildRemoved:Connect(function(child) if child:IsA("Tool") then entry.WeaponName = nil end end)) table.insert(entry.Conns, model.AncestryChanged:Connect(function(_, parent) if not parent then destroyPlayerEntry(model) end end)) PlayerCache[model] = entry end local BoundFolders = {} local bindVehicleContainer local function bindCharactersFolder(folder) if BoundFolders[folder] then return end BoundFolders[folder] = true for _, child in ipairs(folder:GetChildren()) do trackCharacter(child) end connectSignal(folder.ChildAdded, function(child) if isAlive() then trackCharacter(child) end end) connectSignal(folder.ChildRemoved, function(child) destroyPlayerEntry(child) end) end local existingChars = Workspace:FindFirstChild("Characters") if existingChars then bindCharactersFolder(existingChars) end connectSignal(Workspace.ChildAdded, function(child) if not isAlive() then return end if child.Name == "Characters" and child:IsA("Folder") then bindCharactersFolder(child) elseif child.Name == "Vehicles" and child:IsA("Folder") then bindVehicleContainer(child) end end) -- Vehicle tracking (exclusivamente modelos com VehicleNetId) local function trackVehicle(model) if not model:IsA("Model") or VehicleCache[model] then return end if model:GetAttribute("VehicleNetId") == nil then return end local text = newTextLabel(EspGui, 3) VehicleCache[model] = { Model = model, Text = text, } end local function untrackVehicle(model) local v = VehicleCache[model] if not v then return end VehicleCache[model] = nil pcall(function() v.Text:Destroy() end) end function bindVehicleContainer(container) if BoundFolders[container] then return end BoundFolders[container] = true for _, child in ipairs(container:GetChildren()) do trackVehicle(child) end connectSignal(container.ChildAdded, function(child) if isAlive() then trackVehicle(child) end end) connectSignal(container.ChildRemoved, function(child) untrackVehicle(child) end) end local vehFolder = Workspace:FindFirstChild("Vehicles") if vehFolder then bindVehicleContainer(vehFolder) end bindVehicleContainer(Workspace) -- Matematica de BBox R6 e Cores local function computeRigBox2D(camera, entry) local minX, minY = math.huge, math.huge local maxX, maxY = -math.huge, -math.huge local anyInFront = false for _, name in ipairs(LIMB_NAMES) do local part = entry.Limbs[name] if part and part:IsA("BasePart") and part.Parent then local cf = part.CFrame local hs = part.Size * 0.5 for sx = -1, 1, 2 do for sy = -1, 1, 2 do for sz = -1, 1, 2 do local worldPt = cf:PointToWorldSpace(Vector3.new(hs.X * sx, hs.Y * sy, hs.Z * sz)) local vp = camera:WorldToViewportPoint(worldPt) if vp.Z > 0 then anyInFront = true if vp.X < minX then minX = vp.X end if vp.Y < minY then minY = vp.Y end if vp.X > maxX then maxX = vp.X end if vp.Y > maxY then maxY = vp.Y end end end end end end end if not anyInFront or minX == math.huge then return nil end local vpSize = camera.ViewportSize if maxX < -50 or maxY < -50 or minX > vpSize.X + 50 or minY > vpSize.Y + 50 then return nil end local w = math.max(maxX - minX, 4) local h = math.max(maxY - minY, 6) return minX, minY, w, h end local function computeRigCorners3D(entry) local basePart = entry.RootPart or entry.Torso if not basePart or not basePart.Parent then return nil end local cf = basePart.CFrame local invCF = cf:Inverse() local minX, minY, minZ = math.huge, math.huge, math.huge local maxX, maxY, maxZ = -math.huge, -math.huge, -math.huge local found = false for _, name in ipairs(LIMB_NAMES) do local part = entry.Limbs[name] if part and part:IsA("BasePart") and part.Parent then found = true local pcf = invCF * part.CFrame local hs = part.Size * 0.5 for sx = -1, 1, 2 do for sy = -1, 1, 2 do for sz = -1, 1, 2 do local lp = pcf * Vector3.new(hs.X * sx, hs.Y * sy, hs.Z * sz) if lp.X < minX then minX = lp.X end if lp.Y < minY then minY = lp.Y end if lp.Z < minZ then minZ = lp.Z end if lp.X > maxX then maxX = lp.X end if lp.Y > maxY then maxY = lp.Y end if lp.Z > maxZ then maxZ = lp.Z end end end end end end if not found or minX == math.huge then minX, maxX = -1.6, 1.6 minY, maxY = -2.8, 2.5 minZ, maxZ = -1.0, 1.0 end return { cf * Vector3.new(minX, minY, minZ), cf * Vector3.new(maxX, minY, minZ), cf * Vector3.new(maxX, minY, maxZ), cf * Vector3.new(minX, minY, maxZ), cf * Vector3.new(minX, maxY, minZ), cf * Vector3.new(maxX, maxY, minZ), cf * Vector3.new(maxX, maxY, maxZ), cf * Vector3.new(minX, maxY, maxZ), } end local function getLocalTeamName() if LocalPlayer.Team then return LocalPlayer.Team.Name end local ch = LocalPlayer.Character local torso = ch and ch:FindFirstChild("Torso") if torso then local cg = torso.CollisionGroup if cg == "CharNATO" then return "NATO" end if cg == "CharPACT" then return "PACT" end if cg == "CharZombie" then return "Zombies" end end return "Neutral" end local function buildRayIgnoreList(extraCamera) local ignoreList = { Workspace:FindFirstChild("Ignore"), Trails3DFolder } if extraCamera then table.insert(ignoreList, extraCamera) end local ch = LocalPlayer.Character if ch then table.insert(ignoreList, ch) local hum = ch:FindFirstChildOfClass("Humanoid") local seat = hum and hum.SeatPart if seat then local cur = seat.Parent while cur and cur ~= Workspace do if cur:GetAttribute("VehicleNetId") ~= nil then table.insert(ignoreList, cur) break end cur = cur.Parent end end end for i = 1, #CachedArmingExclusions do local ex = CachedArmingExclusions[i] if ex and ex.Parent then table.insert(ignoreList, ex) end end return ignoreList end local function isTransparentPassThrough(inst, targetModel) if not inst or not inst:IsA("BasePart") then return false end if targetModel and inst:IsDescendantOf(targetModel) then return false end if inst:FindFirstAncestorOfClass("Accessory") then return true end if inst.Transparency >= 0.92 then if not inst:FindFirstAncestor("Vehicles") then return true end if string.find(string.lower(inst.Name), "glass", 1, true) then return true end end if (not inst.CanCollide) and inst.Transparency >= 0.55 and not inst:FindFirstAncestor("Vehicles") then return true end return false end local function isPointVisibleWithRay(origin, targetPoint, targetModel, rayParams, baseIgnore) if not isFiniteVec3(origin) or not isFiniteVec3(targetPoint) then return false end pcall(function() rayParams.CollisionGroup = resolveTeamRayGroup(getLocalTeamName()) end) local delta = targetPoint - origin local totalDist = delta.Magnitude if totalDist <= 1e-4 then return true end local dirUnit = delta / totalDist local curOrigin = origin local tempIgnore = baseIgnore local copied = false for _ = 1, 4 do rayParams.FilterDescendantsInstances = tempIgnore local remVec = targetPoint - curOrigin if remVec.Magnitude <= 0.15 or remVec:Dot(dirUnit) <= 0 then return true end local result = Workspace:Raycast(curOrigin, remVec, rayParams) if not result then return true end local hitInst = result.Instance if not hitInst then return true end if targetModel and hitInst:IsDescendantOf(targetModel) then return true end if isTransparentPassThrough(hitInst, targetModel) then if not copied then tempIgnore = table.clone(baseIgnore) copied = true end table.insert(tempIgnore, hitInst) curOrigin = result.Position + dirUnit * 0.05 else return false end end return false end local function findVisiblePointOnPart(origin, targetPart, targetModel, rayParams, baseIgnore, fastMode) if not targetPart or not targetPart.Parent or not isFiniteVec3(targetPart.Position) then return nil end local cf = targetPart.CFrame local sz = targetPart.Size local hx = math.clamp(sz.X * 0.40, 0.06, 1.5) local hy = math.clamp(sz.Y * 0.40, 0.06, 1.5) local hz = math.clamp(sz.Z * 0.40, 0.06, 1.5) local centerPt = cf.Position if isPointVisibleWithRay(origin, centerPt, targetModel, rayParams, baseIgnore) then return centerPt end local pTop = cf * Vector3.new(0, hy, 0) if isPointVisibleWithRay(origin, pTop, targetModel, rayParams, baseIgnore) then return pTop end local pLeft = cf * Vector3.new(-hx, 0, 0) if isPointVisibleWithRay(origin, pLeft, targetModel, rayParams, baseIgnore) then return pLeft end local pRight = cf * Vector3.new(hx, 0, 0) if isPointVisibleWithRay(origin, pRight, targetModel, rayParams, baseIgnore) then return pRight end if fastMode then return nil end local pTopL = cf * Vector3.new(-hx * 0.72, hy * 0.82, 0) if isPointVisibleWithRay(origin, pTopL, targetModel, rayParams, baseIgnore) then return pTopL end local pTopR = cf * Vector3.new(hx * 0.72, hy * 0.82, 0) if isPointVisibleWithRay(origin, pTopR, targetModel, rayParams, baseIgnore) then return pTopR end local pBot = cf * Vector3.new(0, -hy * 0.85, 0) if isPointVisibleWithRay(origin, pBot, targetModel, rayParams, baseIgnore) then return pBot end local pFront = cf * Vector3.new(0, 0, -hz) if isPointVisibleWithRay(origin, pFront, targetModel, rayParams, baseIgnore) then return pFront end local pBack = cf * Vector3.new(0, 0, hz) if isPointVisibleWithRay(origin, pBack, targetModel, rayParams, baseIgnore) then return pBack end return nil end local function isPartVisible(camera, origin, entry, targetModel) if not entry then return false end local baseIgnore = buildRayIgnoreList(camera) if entry.Head and findVisiblePointOnPart(origin, entry.Head, targetModel, VisRayParams, baseIgnore, true) then return true end if entry.Torso and findVisiblePointOnPart(origin, entry.Torso, targetModel, VisRayParams, baseIgnore, true) then return true end return false end local function getEntryTeamInfo(entry, plr) if plr and plr.Team then return plr.Team.Name, plr.TeamColor and plr.TeamColor.Color or nil end local torso = entry.Torso if torso then local cg = torso.CollisionGroup if cg == "CharNATO" then return "NATO", Color3.fromRGB(0, 0, 255) end if cg == "CharPACT" then return "PACT", Color3.fromRGB(255, 0, 0) end if cg == "CharZombie" then return "Zombies", Color3.fromRGB(0, 255, 0) end end return "Neutral", nil end local function resolveTargetColor(teamColor, isAlly, isNeutral, isUnconscious, isVisible) if isUnconscious and Config.HighlightUnconsciousColor then return Config.UnconsciousColor end if Config.ColorMode == "Team Color (Auto)" then if teamColor then return teamColor end if isNeutral then return Config.NeutralColor end end if isNeutral then return Config.NeutralColor end if isAlly then return Config.AllyColor end if Config.UseVisibilityCheck then return isVisible and Config.EnemyVisibleColor or Config.EnemyOccludedColor end return Config.EnemyVisibleColor end local function getHealthBarColor(frac) if frac > 0.5 then local t = (frac - 0.5) * 2 return Config.HealthMidColor:Lerp(Config.HealthFullColor, t) else local t = frac * 2 return Config.HealthLowColor:Lerp(Config.HealthMidColor, t) end end local function formatDistance(studs) if Config.DistanceUnit == "Meters" then return string.format("%dm", math.round(studs * 0.28)) end return string.format("%ds", math.round(studs)) end -- Loop principal de renderizacao local function updateESP() if not isAlive() then return end local camera = Workspace.CurrentCamera if not camera then return end local camPos = camera.CFrame.Position local refPos = camPos if LocalPlayer.Character and LocalPlayer.Character.PrimaryPart then refPos = LocalPlayer.Character.PrimaryPart.Position end local localTeamName = getLocalTeamName() local isLocalNeutral = (localTeamName == "Neutral") local fontEnum = FontMap[Config.TextFont] or Enum.Font.Code local now = os.clock() local statsTotal, statsDrawn, statsSample = 0, 0, nil local chamCandidates = {} for model, entry in pairs(PlayerCache) do statsTotal += 1 local v = entry.Visuals if not Config.Enabled or not model.Parent then hidePlayerVisuals(v) continue end if not entry.Player then entry.Player = resolvePlayerForCharacter(model) end local root = entry.RootPart local torso = entry.Torso if not root or not root.Parent then refreshCharacterParts(entry) root = entry.RootPart torso = entry.Torso end if not root or not torso then hidePlayerVisuals(v) continue end local plr = entry.Player local targetTeamName, targetTeamColor = getEntryTeamInfo(entry, plr) local isNeutral = (targetTeamName == "Neutral") local isAlly = (not isLocalNeutral) and (not isNeutral) and (targetTeamName == localTeamName) if isNeutral and not Config.ShowNeutral then hidePlayerVisuals(v) continue elseif isAlly and not Config.ShowAllies then hidePlayerVisuals(v) continue elseif (not isAlly) and (not isNeutral) and not Config.ShowEnemies then hidePlayerVisuals(v) continue end local distStuds = (root.Position - refPos).Magnitude local distShow = (Config.DistanceUnit == "Meters") and (distStuds * 0.28) or distStuds if distShow > Config.MaxDistance then hidePlayerVisuals(v) continue end if isEntryDead(entry) then hidePlayerVisuals(v) continue end local isUnconscious = entry.Unconscious and entry.Unconscious.Value == true or false if isUnconscious and Config.IgnoreUnconscious then hidePlayerVisuals(v) continue end local curHp, maxHp = getCharacterHealth(entry) if curHp <= 0 and not isUnconscious then hidePlayerVisuals(v) continue end if Config.UseVisibilityCheck then if now - entry.LastVisCheck >= 0.065 then entry.LastVisCheck = now entry.LastVisible = isPartVisible(camera, camPos, entry, model) end else entry.LastVisible = true end local mainColor = resolveTargetColor(targetTeamColor, isAlly, isNeutral, isUnconscious, entry.LastVisible) -- Coleta candidato de Chams (funciona mesmo fora do frustum, limitado aos 28 mais proximos) if Config.ChamsEnabled then table.insert(chamCandidates, { entry = entry, dist = distStuds, color = mainColor, }) elseif v.Highlight.Enabled then v.Highlight.Enabled = false end local bx, by, bw, bh = computeRigBox2D(camera, entry) if not bx then -- Oculta 2D mas preserva Highlight se estiver na lista de Chams v.BoxOutlineFrame.Visible = false v.BoxFrame.Visible = false for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i].Visible = false v.Corners[i].Visible = false end for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end for i = 1, SKELETON_CONNS_COUNT do v.Skeleton[i].Visible = false end v.HealthBg.Visible = false v.HealthBar.Visible = false v.ShockBar.Visible = false v.HealthText.Visible = false v.TopText.Visible = false v.BottomText.Visible = false v.Tracer.Visible = false continue end -- 1. BOX (2D Full / Corners / Off) local boxColor = Config.BoxUseCustomColor and Config.BoxCustomColor or mainColor local boxGuiTransp = 1 - math.clamp(Config.BoxTransparency, 0, 1) if Config.BoxMode == "2D Full" then for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i].Visible = false v.Corners[i].Visible = false end for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end if Config.BoxOutline then v.BoxOutlineFrame.Position = UDim2.fromOffset(bx - 1, by - 1) v.BoxOutlineFrame.Size = UDim2.fromOffset(bw + 2, bh + 2) v.BoxOutlineStroke.Thickness = Config.BoxThickness + 1.5 v.BoxOutlineStroke.Transparency = boxGuiTransp v.BoxOutlineFrame.Visible = true else v.BoxOutlineFrame.Visible = false end v.BoxFrame.Position = UDim2.fromOffset(bx, by) v.BoxFrame.Size = UDim2.fromOffset(bw, bh) v.BoxStroke.Color = boxColor v.BoxStroke.Thickness = Config.BoxThickness v.BoxStroke.Transparency = boxGuiTransp if Config.BoxFill then v.BoxFrame.BackgroundColor3 = boxColor v.BoxFrame.BackgroundTransparency = 1 - math.clamp(Config.BoxFillTransparency, 0, 1) else v.BoxFrame.BackgroundTransparency = 1 end v.BoxFrame.Visible = true elseif Config.BoxMode == "Corners" then v.BoxOutlineFrame.Visible = false for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end if Config.BoxFill then v.BoxFrame.Position = UDim2.fromOffset(bx, by) v.BoxFrame.Size = UDim2.fromOffset(bw, bh) v.BoxFrame.BackgroundColor3 = boxColor v.BoxFrame.BackgroundTransparency = 1 - math.clamp(Config.BoxFillTransparency, 0, 1) v.BoxStroke.Transparency = 1 v.BoxFrame.Visible = true else v.BoxFrame.Visible = false end local cw = math.max(bw * 0.25, 3) local ch = math.max(bh * 0.20, 3) local segs = { { Vector2.new(bx, by), Vector2.new(bx + cw, by) }, { Vector2.new(bx, by), Vector2.new(bx, by + ch) }, { Vector2.new(bx + bw, by), Vector2.new(bx + bw - cw, by) }, { Vector2.new(bx + bw, by), Vector2.new(bx + bw, by + ch) }, { Vector2.new(bx, by + bh), Vector2.new(bx + cw, by + bh) }, { Vector2.new(bx, by + bh), Vector2.new(bx, by + bh - ch) }, { Vector2.new(bx + bw, by + bh), Vector2.new(bx + bw - cw, by + bh) }, { Vector2.new(bx + bw, by + bh), Vector2.new(bx + bw, by + bh - ch) }, } for i = 1, 8 do local p1, p2 = segs[i][1], segs[i][2] if Config.BoxOutline then drawLine2D(v.CornerOutlines[i], p1, p2, Color3.new(0, 0, 0), Config.BoxThickness + 2, Config.BoxTransparency) else v.CornerOutlines[i].Visible = false end drawLine2D(v.Corners[i], p1, p2, boxColor, Config.BoxThickness, Config.BoxTransparency) end elseif Config.BoxMode == "3D Box" then v.BoxOutlineFrame.Visible = false v.BoxFrame.Visible = false for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i].Visible = false v.Corners[i].Visible = false end local corners3D = computeRigCorners3D(entry) if corners3D then for i = 1, BOX_3D_EDGES_COUNT do local pair = BOX_3D_EDGE_PAIRS[i] local a2, b2 = clipAndProjectSegment(camera, corners3D[pair[1]], corners3D[pair[2]]) if a2 and b2 then drawLine2D(v.Box3DLines[i], a2, b2, boxColor, Config.BoxThickness, Config.BoxTransparency) else v.Box3DLines[i].Visible = false end end else for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end end else v.BoxOutlineFrame.Visible = false v.BoxFrame.Visible = false for i = 1, BOX_CORNER_LINES do v.CornerOutlines[i].Visible = false v.Corners[i].Visible = false end for i = 1, BOX_3D_EDGES_COUNT do v.Box3DLines[i].Visible = false end end -- 2. SKELETON R6 if Config.SkeletonEnabled and entry.Head and torso and entry.LeftArm and entry.RightArm and entry.LeftLeg and entry.RightLeg then local skelColor = Config.SkeletonUseCustomColor and Config.SkeletonCustomColor or mainColor local tcf, ts = torso.CFrame, torso.Size local headPt = entry.Head.Position local neckPt = tcf:PointToWorldSpace(Vector3.new(0, ts.Y * 0.45, 0)) local pelvisPt = tcf:PointToWorldSpace(Vector3.new(0, -ts.Y * 0.45, 0)) local lShPt = tcf:PointToWorldSpace(Vector3.new(-ts.X * 0.5, ts.Y * 0.35, 0)) local rShPt = tcf:PointToWorldSpace(Vector3.new(ts.X * 0.5, ts.Y * 0.35, 0)) local lHandPt = entry.LeftArm.CFrame:PointToWorldSpace(Vector3.new(0, -entry.LeftArm.Size.Y * 0.45, 0)) local rHandPt = entry.RightArm.CFrame:PointToWorldSpace(Vector3.new(0, -entry.RightArm.Size.Y * 0.45, 0)) local lFootPt = entry.LeftLeg.CFrame:PointToWorldSpace(Vector3.new(0, -entry.LeftLeg.Size.Y * 0.45, 0)) local rFootPt = entry.RightLeg.CFrame:PointToWorldSpace(Vector3.new(0, -entry.RightLeg.Size.Y * 0.45, 0)) local bonePairs = { { headPt, neckPt }, { neckPt, pelvisPt }, { lShPt, rShPt }, { lShPt, lHandPt }, { rShPt, rHandPt }, { pelvisPt, lFootPt }, { pelvisPt, rFootPt }, { neckPt, torso.Position }, } for i = 1, SKELETON_CONNS_COUNT do local a2 = camera:WorldToViewportPoint(bonePairs[i][1]) local b2 = camera:WorldToViewportPoint(bonePairs[i][2]) if a2.Z > 0 and b2.Z > 0 then drawLine2D(v.Skeleton[i], Vector2.new(a2.X, a2.Y), Vector2.new(b2.X, b2.Y), skelColor, Config.SkeletonThickness, Config.SkeletonTransparency) else v.Skeleton[i].Visible = false end end else for i = 1, SKELETON_CONNS_COUNT do v.Skeleton[i].Visible = false end end -- 3. HEALTH BAR & SHOCK BAR if Config.HealthBarEnabled then local frac = math.clamp(curHp / math.max(maxHp, 1), 0, 1) local barW = Config.HealthBarWidth local barX = bx - barW - 4 local fillH = math.max(bh * frac, 1) v.HealthBg.Position = UDim2.fromOffset(barX - 1, by - 1) v.HealthBg.Size = UDim2.fromOffset(barW + 2, bh + 2) v.HealthBg.Visible = true v.HealthBar.Position = UDim2.fromOffset(barX, by + (bh - fillH)) v.HealthBar.Size = UDim2.fromOffset(barW, fillH) v.HealthBar.BackgroundColor3 = getHealthBarColor(frac) v.HealthBar.Visible = true if Config.HealthTextEnabled and frac < 0.99 then v.HealthText.Text = tostring(math.round(curHp)) v.HealthText.Position = UDim2.fromOffset(barX + barW * 0.5, by + (bh - fillH) - 13) v.HealthText.TextSize = math.max(Config.TextSize - 2, 10) v.HealthText.Font = fontEnum v.HealthText.TextStrokeTransparency = Config.TextOutline and 0 or 1 v.HealthText.Visible = true else v.HealthText.Visible = false end if Config.ShockBarEnabled and entry.Shock then local shockFrac = math.clamp(entry.Shock.Value / 100, 0, 1) local shH = math.max(bh * shockFrac, 0) if shH > 0 then v.ShockBar.Position = UDim2.fromOffset(barX - 4, by + (bh - shH)) v.ShockBar.Size = UDim2.fromOffset(2, shH) v.ShockBar.BackgroundColor3 = Config.ShockColor v.ShockBar.Visible = true else v.ShockBar.Visible = false end else v.ShockBar.Visible = false end else v.HealthBg.Visible = false v.HealthBar.Visible = false v.ShockBar.Visible = false v.HealthText.Visible = false end -- 4. TEXTOS (Topo e Base) local textColor = Config.TextUseCustomColor and Config.TextCustomColor or mainColor local textTransp = 1 - math.clamp(Config.TextTransparency, 0, 1) local topParts = {} if Config.TeamTagEnabled then if isAlly then table.insert(topParts, "[ALLY]") elseif not isNeutral then table.insert(topParts, "[" .. targetTeamName .. "]") end end if Config.NameEnabled then local display = (Config.UseDisplayName and plr) and plr.DisplayName or model.Name table.insert(topParts, display) end if Config.ClassEnabled and entry.ClassType and entry.ClassType.Value ~= "" then table.insert(topParts, "[" .. entry.ClassType.Value .. "]") end if isUnconscious then table.insert(topParts, "[DOWN]") end if #topParts > 0 then v.TopText.Text = table.concat(topParts, " ") v.TopText.Position = UDim2.fromOffset(bx + bw * 0.5, by - Config.TextSize - 7) v.TopText.TextSize = Config.TextSize v.TopText.Font = fontEnum v.TopText.TextColor3 = textColor v.TopText.TextTransparency = textTransp v.TopText.TextStrokeTransparency = Config.TextOutline and textTransp or 1 v.TopText.Visible = true else v.TopText.Visible = false end local botParts = {} if Config.DistanceEnabled then table.insert(botParts, formatDistance(distStuds)) end if Config.WeaponEnabled then table.insert(botParts, getEquippedWeaponLabel(entry)) end if Config.StanceEnabled and entry.Stance and entry.Stance.Value ~= "" then table.insert(botParts, entry.Stance.Value) end if #botParts > 0 then v.BottomText.Text = table.concat(botParts, " | ") v.BottomText.Position = UDim2.fromOffset(bx + bw * 0.5, by + bh + 4) v.BottomText.TextSize = math.max(Config.TextSize - 1, 10) v.BottomText.Font = fontEnum v.BottomText.TextColor3 = textColor v.BottomText.TextTransparency = textTransp v.BottomText.TextStrokeTransparency = Config.TextOutline and textTransp or 1 v.BottomText.Visible = true else v.BottomText.Visible = false end -- 5. TRACER if Config.TracerEnabled then local vpSize = camera.ViewportSize local origin2D if Config.TracerOrigin == "Top" then origin2D = Vector2.new(vpSize.X * 0.5, 0) elseif Config.TracerOrigin == "Center" then origin2D = Vector2.new(vpSize.X * 0.5, vpSize.Y * 0.5) elseif Config.TracerOrigin == "Mouse" then origin2D = UserInputService:GetMouseLocation() else origin2D = Vector2.new(vpSize.X * 0.5, vpSize.Y) end local target2D if Config.TracerTarget == "Head" then target2D = Vector2.new(bx + bw * 0.5, by) elseif Config.TracerTarget == "Center" then target2D = Vector2.new(bx + bw * 0.5, by + bh * 0.5) else target2D = Vector2.new(bx + bw * 0.5, by + bh) end local tColor = Config.TracerUseCustomColor and Config.TracerCustomColor or mainColor drawLine2D(v.Tracer, origin2D, target2D, tColor, Config.TracerThickness, Config.TracerTransparency) else v.Tracer.Visible = false end statsDrawn += 1 if not statsSample then statsSample = string.format("%s (%s, ally=%s) box=(%.0f,%.0f,%.0f,%.0f) hp=%.0f/%.0f", model.Name, targetTeamName, tostring(isAlly), bx, by, bw, bh, curHp, maxHp ) end end -- Aplicar Chams somente nos 28 mais proximos (respeitando limite de 31 Highlights do Roblox) if Config.ChamsEnabled and #chamCandidates > 0 then table.sort(chamCandidates, function(a, b) return a.dist < b.dist end) local depthMode = (Config.ChamsDepthMode == "Occluded") and Enum.HighlightDepthMode.Occluded or Enum.HighlightDepthMode.AlwaysOnTop for idx, item in ipairs(chamCandidates) do local h = item.entry.Visuals.Highlight if idx <= MAX_ACTIVE_CHAMS then h.FillColor = Config.ChamsUseCustomColor and Config.ChamsFillColor or item.color h.OutlineColor = Config.ChamsUseCustomColor and Config.ChamsOutlineColor or item.color h.FillTransparency = Config.ChamsFillTransparency h.OutlineTransparency = Config.ChamsOutlineTransparency h.DepthMode = depthMode if not h.Enabled then h.Enabled = true end else if h.Enabled then h.Enabled = false end end end end -- Veiculos (apenas com VehicleNetId) local vehDrawn = 0 for model, ventry in pairs(VehicleCache) do local t = ventry.Text if not Config.Enabled or not Config.VehicleEspEnabled or not model.Parent then t.Visible = false continue end local anchor = model:FindFirstChild("RootPart") or model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart") if not anchor then t.Visible = false continue end local distStuds = (anchor.Position - refPos).Magnitude local distShow = (Config.DistanceUnit == "Meters") and (distStuds * 0.28) or distStuds if distShow > Config.VehicleMaxDistance then t.Visible = false continue end local vp = camera:WorldToViewportPoint(anchor.Position + Vector3.new(0, 4, 0)) if vp.Z <= 0 then t.Visible = false continue end local vTeam = model:GetAttribute("Team") local vIsAlly = (not isLocalNeutral) and type(vTeam) == "string" and vTeam == localTeamName if Config.VehicleFilter == "Enemy Only" and (vIsAlly or type(vTeam) ~= "string") then t.Visible = false continue elseif Config.VehicleFilter == "Ally Only" and not vIsAlly then t.Visible = false continue end local vColor = Config.VehicleColor if Config.VehicleUseTeamColor and type(vTeam) == "string" then if Config.ColorMode == "Enemy / Ally" and not isLocalNeutral then vColor = vIsAlly and Config.AllyColor or Config.EnemyVisibleColor else local teamObj = Teams:FindFirstChild(vTeam) if teamObj and teamObj:IsA("Team") then vColor = teamObj.TeamColor.Color end end end local tagTeam = type(vTeam) == "string" and (" [" .. vTeam .. "]") or "" t.Text = string.format("[VEH] %s%s | %s", model.Name, tagTeam, formatDistance(distStuds)) t.Position = UDim2.fromOffset(vp.X, vp.Y) t.TextSize = Config.TextSize t.Font = fontEnum t.TextColor3 = vColor t.TextStrokeTransparency = Config.TextOutline and 0 or 1 t.Visible = true vehDrawn += 1 end if type(getgenv) == "function" then local effRecoil = Config.NoRecoil and 0 or math.clamp((tonumber(Config.RecoilPercent) or 100) / 100, 0, 1) local effSway = Config.NoBreathSway and 0 or math.clamp((tonumber(Config.BreathSwayPercent) or 100) / 100, 0, 1) getgenv().__GF_ESP_STATS = { total = statsTotal, drawn = statsDrawn, vehiclesDrawn = vehDrawn, localTeam = localTeamName, showAllies = Config.ShowAllies, sample = statsSample, recoilHooked = (RecoilControllerMod ~= nil), hipAimHooked = (HipAimMod ~= nil), breathingHooked = (BreathingMod ~= nil), silentAimHooked = (ClientFireMod ~= nil), vehicleHooksReady = (EngineMod ~= nil and WheelDriveMod ~= nil and TrackDriveMod ~= nil), turretHookReady = (TurretCtrlMod ~= nil), effectiveRecoilScale = effRecoil, effectiveSwayScale = effSway, updatedAt = now, } end end -- ========================== -- BALISTICA: TRAJETORIA & PREVIA -- ========================== local MAX_TRAIL_SEGMENTS = 180 local MAX_IMPACT_MARKERS = 24 local MAX_PREVIEW_STEPS = 28 local TrailSegments = {} -- { p0, p1, t } local ImpactMarkers = {} -- { pos, normal, label, isEnemyHit, t } local TrailParts3D = {} -- { part, t } local TrailFolder = Instance.new("Folder") TrailFolder.Name = "GF_Trail2D" TrailFolder.Parent = EspGui local TrailLinePool = {} for i = 1, MAX_TRAIL_SEGMENTS do TrailLinePool[i] = newLineFrame(TrailFolder, 4) end local ImpactPool = {} for i = 1, MAX_IMPACT_MARKERS do local dot = Instance.new("Frame") dot.AnchorPoint = Vector2.new(0.5, 0.5) dot.Size = UDim2.fromOffset(7, 7) dot.BorderSizePixel = 0 dot.Visible = false dot.ZIndex = 5 dot.Parent = TrailFolder local corner = Instance.new("UICorner") corner.CornerRadius = UDim.new(1, 0) corner.Parent = dot local stroke = Instance.new("UIStroke") stroke.Color = Color3.new(0, 0, 0) stroke.Thickness = 1 stroke.Parent = dot local lbl = newTextLabel(TrailFolder, 5) lbl.TextSize = 11 lbl.Font = Enum.Font.Code ImpactPool[i] = { Dot = dot, Stroke = stroke, Label = lbl } end local PreviewFolder = Instance.new("Folder") PreviewFolder.Name = "GF_Preview2D" PreviewFolder.Parent = EspGui local PreviewLinePool = {} for i = 1, MAX_PREVIEW_STEPS do PreviewLinePool[i] = newLineFrame(PreviewFolder, 4) end local PreviewDot = Instance.new("Frame") PreviewDot.AnchorPoint = Vector2.new(0.5, 0.5) PreviewDot.Size = UDim2.fromOffset(10, 10) PreviewDot.BackgroundTransparency = 0.25 PreviewDot.BorderSizePixel = 0 PreviewDot.Visible = false PreviewDot.ZIndex = 5 PreviewDot.Parent = PreviewFolder local PreviewCorner = Instance.new("UICorner") PreviewCorner.CornerRadius = UDim.new(1, 0) PreviewCorner.Parent = PreviewDot local PreviewStroke = Instance.new("UIStroke") PreviewStroke.Color = Color3.new(0, 0, 0) PreviewStroke.Thickness = 1.5 PreviewStroke.Parent = PreviewDot local PreviewLabel = newTextLabel(PreviewFolder, 5) PreviewLabel.TextSize = 12 PreviewLabel.Font = Enum.Font.Code -- Carrega modulos balisticos com pcall local WeaponSourceMod, TrajectoryMod, ZeroControllerMod, AimControllerMod, WeaponViewmodelMod = nil, nil, nil, nil, nil task.spawn(function() pcall(function() local shared = ReplicatedStorage:WaitForChild("Shared", 5) local ballistics = shared:WaitForChild("Ballistics", 5) WeaponSourceMod = require(ballistics:WaitForChild("Sources"):WaitForChild("WeaponSource")) TrajectoryMod = require(ballistics:WaitForChild("Trajectory")) pcall(function() ArmingMod = require(ballistics:WaitForChild("Arming")) end) pcall(function() CollisionGroupsMod = require(shared:WaitForChild("CollisionGroups")) end) local controllers = ReplicatedStorage:WaitForChild("Client"):WaitForChild("Tools"):WaitForChild("Weapon"):WaitForChild("controllers") ZeroControllerMod = require(controllers:WaitForChild("ZeroController")) AimControllerMod = require(controllers:WaitForChild("AimController")) WeaponViewmodelMod = require(controllers:WaitForChild("WeaponViewmodel")) end) while isAlive() do if ArmingMod and type(ArmingMod.weaponRayExclusions) == "function" then local okEx, exList = pcall(ArmingMod.weaponRayExclusions) if okEx and type(exList) == "table" then CachedArmingExclusions = exList end end task.wait(2.0) end end) local PreviewRayParams = RaycastParams.new() PreviewRayParams.FilterType = Enum.RaycastFilterType.Exclude PreviewRayParams.IgnoreWater = true local function spawn3DSegment(p0, p1, color, thickness) if not Trails3DFolder or not Trails3DFolder.Parent then return end local dist = (p1 - p0).Magnitude if dist < 0.05 then return end local w = math.clamp(thickness * 0.05, 0.04, 0.25) local part = Instance.new("Part") part.Anchored = true part.CanCollide = false part.CanQuery = false part.CanTouch = false part.CastShadow = false part.Material = Enum.Material.Neon part.Color = color part.Transparency = 0.15 part.Size = Vector3.new(w, w, dist) part.CFrame = CFrame.lookAt((p0 + p1) * 0.5, p1) part.Parent = Trails3DFolder table.insert(TrailParts3D, { part = part, t = os.clock() }) if #TrailParts3D > MAX_TRAIL_SEGMENTS then local oldest = table.remove(TrailParts3D, 1) if oldest and oldest.part then pcall(function() oldest.part:Destroy() end) end end end local function classifyImpactHit(hit) local inst = hit and hit.Instance if not inst then return nil, false end local mdl = inst:FindFirstAncestorOfClass("Model") if mdl and mdl:FindFirstAncestor("Characters") or (mdl and mdl:FindFirstChildOfClass("Humanoid")) then local plr = resolvePlayerForCharacter(mdl) local targetTeam = getEntryTeamInfo({ Torso = mdl:FindFirstChild("Torso") }, plr) local isEnemy = targetTeam ~= getLocalTeamName() return string.format("%s (%s)", mdl.Name, inst.Name), isEnemy end return nil, false end -- Hook seguro em BallisticsClient.ShotDebug (restaurado no Unload/reload) task.spawn(function() local ps = LocalPlayer:WaitForChild("PlayerScripts", 10) local bc = ps and ps:WaitForChild("BallisticsClient", 10) local sdInst = bc and bc:WaitForChild("ShotDebug", 10) if not sdInst or not isAlive() then return end local ok, mod = pcall(require, sdInst) if not ok or type(mod) ~= "table" then return end ShotDebugMod = mod OrigShotDebugStep = mod.onStep OrigShotDebugImpact = mod.onImpact mod.onStep = function(proj, p0, p1, speed) if isAlive() and Config.BulletTrailEnabled and typeof(p0) == "Vector3" and typeof(p1) == "Vector3" then table.insert(TrailSegments, { p0 = p0, p1 = p1, t = os.clock() }) if #TrailSegments > MAX_TRAIL_SEGMENTS then table.remove(TrailSegments, 1) end if Config.BulletTrail3D then spawn3DSegment(p0, p1, Config.BulletTrailColor, Config.BulletTrailThickness) end end if OrigShotDebugStep then return OrigShotDebugStep(proj, p0, p1, speed) end end mod.onImpact = function(hit) if isAlive() and Config.BulletTrailEnabled and Config.BulletImpactMarker and hit and typeof(hit.Position) == "Vector3" then local hitInfo, isEnemyHit = classifyImpactHit(hit) local cam = Workspace.CurrentCamera local distStr = cam and formatDistance((hit.Position - cam.CFrame.Position).Magnitude) or "" local label = hitInfo and (hitInfo .. " • " .. distStr) or distStr table.insert(ImpactMarkers, { pos = hit.Position, label = label, isEnemyHit = isEnemyHit, t = os.clock(), }) if #ImpactMarkers > MAX_IMPACT_MARKERS then table.remove(ImpactMarkers, 1) end end if OrigShotDebugImpact then return OrigShotDebugImpact(hit) end end end) -- ========================== -- MODIFICAR ARMA: RECOIL & ESTABILIDADE -- ========================== local function cleanFiniteNum(v, fallback) if type(v) ~= "number" or v ~= v or math.abs(v) > 1e6 then return fallback end return v == 0 and 0 or v end local function getEffectiveRecoilScale() if not isAlive() then return 1 end if Config.NoRecoil then return 0 end return math.clamp((tonumber(Config.RecoilPercent) or 100) / 100, 0, 1) end local function getEffectiveSwayScale() if not isAlive() then return 1 end if Config.NoBreathSway then return 0 end return math.clamp((tonumber(Config.BreathSwayPercent) or 100) / 100, 0, 1) end task.spawn(function() local clientFolder = ReplicatedStorage:WaitForChild("Client", 10) if not clientFolder or not isAlive() then return end local okRc, rcMod = pcall(function() return require(clientFolder:WaitForChild("Tools"):WaitForChild("Weapon"):WaitForChild("controllers"):WaitForChild("RecoilController")) end) if okRc and type(rcMod) == "table" and isAlive() then RecoilControllerMod = rcMod OrigRecoilScaleFn = rcMod.layLD9LwlI OrigRecoilKickFn = rcMod.rNDvKCHx7N if type(OrigRecoilScaleFn) == "function" then rcMod.layLD9LwlI = function(...) local scale = getEffectiveRecoilScale() if scale <= 0 then return 0 end local base = cleanFiniteNum(OrigRecoilScaleFn(...), 1) return cleanFiniteNum(base * scale, 1) end end if type(OrigRecoilKickFn) == "function" then rcMod.rNDvKCHx7N = function(...) if getEffectiveRecoilScale() <= 0 then return end return OrigRecoilKickFn(...) end end end local okHip, hipMod = pcall(function() return require(clientFolder:WaitForChild("Tools"):WaitForChild("Weapon"):WaitForChild("controllers"):WaitForChild("HipAim")) end) if okHip and type(hipMod) == "table" and isAlive() then HipAimMod = hipMod OrigHipAimKickFn = hipMod.kick if type(OrigHipAimKickFn) == "function" then hipMod.kick = function(a1, a2, ...) if getEffectiveRecoilScale() <= 0 then return end return OrigHipAimKickFn(a1, a2, ...) end end end local okBr, brMod = pcall(function() return require(clientFolder:WaitForChild("Character"):WaitForChild("Breathing")) end) if okBr and type(brMod) == "table" and isAlive() then BreathingMod = brMod OrigBreathingSwayFn = brMod.getSway if type(OrigBreathingSwayFn) == "function" then brMod.getSway = function(...) local scale = getEffectiveSwayScale() if scale <= 0 then return 0, 0 end local sx, sy = OrigBreathingSwayFn(...) sx = cleanFiniteNum(sx, 0) sy = cleanFiniteNum(sy, 0) return cleanFiniteNum(sx * scale, 0), cleanFiniteNum(sy * scale, 0) end end end end) local function findMuzzleWorldCFrame(tool, camera) if WeaponViewmodelMod and type(WeaponViewmodelMod.isShown) == "function" then local ok, shown = pcall(WeaponViewmodelMod.isShown) if ok and shown then local ign = Workspace:FindFirstChild("Ignore") if ign then local vm = ign:FindFirstChild(tool.Name .. "Viewmodel") local vmHandle = vm and vm:FindFirstChild("Handle", true) local vmMuzzle = (vmHandle and vmHandle:FindFirstChild("Muzzle1")) or (vm and vm:FindFirstChild("Muzzle1", true)) if vmMuzzle and vmMuzzle:IsA("Attachment") then return vmMuzzle.WorldCFrame end end end end local handle = tool:FindFirstChild("Handle") local m1 = handle and handle:FindFirstChild("Muzzle1") if m1 and m1:IsA("Attachment") then return m1.WorldCFrame end return camera.CFrame end local function updateBallisticsRender() if not isAlive() then return end local camera = Workspace.CurrentCamera if not camera then return end local now = os.clock() local dur = math.max(Config.BulletTrailDuration, 0.2) -- 1. Limpar e renderizar segmentos de rastro 2D for i = #TrailParts3D, 1, -1 do local item = TrailParts3D[i] local age = now - item.t if age >= dur or not item.part or not item.part.Parent then if item.part then pcall(function() item.part:Destroy() end) end table.remove(TrailParts3D, i) elseif item.part then item.part.Transparency = math.clamp(0.15 + (age / dur) * 0.85, 0, 1) end end local lineIdx = 0 if Config.BulletTrailEnabled then for i = #TrailSegments, 1, -1 do local seg = TrailSegments[i] local age = now - seg.t if age >= dur then table.remove(TrailSegments, i) elseif lineIdx < MAX_TRAIL_SEGMENTS then local a2, b2 = clipAndProjectSegment(camera, seg.p0, seg.p1) if a2 and b2 then lineIdx += 1 local alpha = 1 - (age / dur) drawLine2D(TrailLinePool[lineIdx], a2, b2, Config.BulletTrailColor, Config.BulletTrailThickness, alpha) end end end end for i = lineIdx + 1, MAX_TRAIL_SEGMENTS do TrailLinePool[i].Visible = false end -- 2. Marcadores de impacto local impIdx = 0 if Config.BulletTrailEnabled and Config.BulletImpactMarker then for i = #ImpactMarkers, 1, -1 do local imp = ImpactMarkers[i] local age = now - imp.t if age >= dur then table.remove(ImpactMarkers, i) elseif impIdx < MAX_IMPACT_MARKERS then local vp = camera:WorldToViewportPoint(imp.pos) if vp.Z > 0 then impIdx += 1 local alpha = 1 - (age / dur) local slot = ImpactPool[impIdx] local col = imp.isEnemyHit and Config.BulletImpactHitColor or Config.BulletImpactColor slot.Dot.Position = UDim2.fromOffset(vp.X, vp.Y) slot.Dot.BackgroundColor3 = col slot.Dot.BackgroundTransparency = 1 - alpha slot.Stroke.Transparency = 1 - alpha slot.Dot.Visible = true if imp.label and imp.label ~= "" then slot.Label.Text = imp.label slot.Label.Position = UDim2.fromOffset(vp.X, vp.Y + 6) slot.Label.TextColor3 = col slot.Label.TextTransparency = 1 - alpha slot.Label.TextStrokeTransparency = 1 - alpha slot.Label.Visible = true else slot.Label.Visible = false end end end end end for i = impIdx + 1, MAX_IMPACT_MARKERS do ImpactPool[i].Dot.Visible = false ImpactPool[i].Label.Visible = false end -- 3. Previa balistica ao vivo (antes de atirar) local prevLines = 0 local showPreview = Config.BulletPreviewEnabled and WeaponSourceMod and TrajectoryMod if showPreview and Config.BulletPreviewOnlyADS then local aiming = false if AimControllerMod then local ok, res = pcall(AimControllerMod.isAiming) aiming = ok and res == true end showPreview = aiming end local previewHitPos = nil local previewHitEnemy = false if showPreview then local ch = LocalPlayer.Character local tool = ch and ch:FindFirstChildWhichIsA("Tool") local fp = nil if tool then local okFp, resFp = pcall(WeaponSourceMod.toFireParams, { Tool = tool, MuzzleIndex = 1, BulletIndex = 1, Owner = LocalPlayer }) if okFp then fp = resFp end end local wStats = fp and fp.Weapon local muzzleSpeed = (wStats and wStats.MuzzleSpeed) or (fp and fp.MuzzleSpeed) local dragK = (wStats and wStats.K) or (fp and fp.K) or 0 if fp and type(muzzleSpeed) == "number" and muzzleSpeed > 10 then local muzzleCF = findMuzzleWorldCFrame(tool, camera) local zAngle = 0 if ZeroControllerMod and type(ZeroControllerMod.zeroAngle) == "function" then local ok, za = pcall(ZeroControllerMod.zeroAngle) if ok and type(za) == "number" and za == za then zAngle = za end end local launchDir = (muzzleCF * CFrame.Angles(zAngle, 0, 0)).LookVector if launchDir.X == launchDir.X and muzzleCF.Position.X == muzzleCF.Position.X then local traj = TrajectoryMod.new({ Origin = muzzleCF.Position, Direction = launchDir, MuzzleSpeed = muzzleSpeed, K = dragK, Gravity = fp.Gravity, }) local prevIgnore = { ch, Workspace:FindFirstChild("Ignore"), Trails3DFolder } for i = 1, #CachedArmingExclusions do local ex = CachedArmingExclusions[i] if ex and ex.Parent then table.insert(prevIgnore, ex) end end PreviewRayParams.FilterDescendantsInstances = prevIgnore pcall(function() PreviewRayParams.CollisionGroup = resolveTeamRayGroup(getLocalTeamName()) end) local prevPt = muzzleCF.Position local dt = 0.035 local maxT = math.min((fp and fp.MaxTime) or 2.5, 1.4) for step = 1, MAX_PREVIEW_STEPS do local t = step * dt if t > maxT then break end local nextPt = TrajectoryMod.GetPositionAtTime(traj, t) if typeof(nextPt) ~= "Vector3" or nextPt.X ~= nextPt.X then break end local hit = Workspace:Raycast(prevPt, nextPt - prevPt, PreviewRayParams) local segEnd = hit and hit.Position or nextPt local a2, b2 = clipAndProjectSegment(camera, prevPt, segEnd) if a2 and b2 then prevLines += 1 drawLine2D( PreviewLinePool[prevLines], a2, b2, Config.BulletPreviewColor, Config.BulletPreviewThickness, 0.85 ) end if hit then previewHitPos = hit.Position local _, isEn = classifyImpactHit(hit) previewHitEnemy = isEn break end prevPt = nextPt end end end end for i = prevLines + 1, MAX_PREVIEW_STEPS do PreviewLinePool[i].Visible = false end if previewHitPos then local vp = camera:WorldToViewportPoint(previewHitPos) if vp.Z > 0 then local col = previewHitEnemy and Config.BulletPreviewTargetColor or Config.BulletPreviewColor PreviewDot.Position = UDim2.fromOffset(vp.X, vp.Y) PreviewDot.BackgroundColor3 = col PreviewDot.Visible = true PreviewLabel.Text = formatDistance((previewHitPos - camera.CFrame.Position).Magnitude) PreviewLabel.Position = UDim2.fromOffset(vp.X, vp.Y + 8) PreviewLabel.TextColor3 = col PreviewLabel.Visible = true else PreviewDot.Visible = false PreviewLabel.Visible = false end else PreviewDot.Visible = false PreviewLabel.Visible = false end end connectSignal(RunService.RenderStepped, updateESP) connectSignal(RunService.RenderStepped, updateBallisticsRender) -- ========================== -- SILENT AIM (CLIENTFIRE + BALISTICA REAL) -- ========================== local SILENT_PARTS_LIST = { "Head", "Torso", "Left Arm", "Right Arm", "Left Leg", "Right Leg" } local SilentRayParams = RaycastParams.new() SilentRayParams.FilterType = Enum.RaycastFilterType.Exclude SilentRayParams.IgnoreWater = true local SilentFovFrame = Instance.new("Frame") SilentFovFrame.Name = "GF_SilentFov" SilentFovFrame.AnchorPoint = Vector2.new(0.5, 0.5) SilentFovFrame.Position = UDim2.fromScale(0.5, 0.5) SilentFovFrame.BackgroundTransparency = 1 SilentFovFrame.Visible = false SilentFovFrame.ZIndex = 6 SilentFovFrame.Parent = EspGui local SilentFovCorner = Instance.new("UICorner") SilentFovCorner.CornerRadius = UDim.new(1, 0) SilentFovCorner.Parent = SilentFovFrame local SilentFovStroke = Instance.new("UIStroke") SilentFovStroke.Thickness = 1.4 SilentFovStroke.Color = Config.SilentAimFovColor SilentFovStroke.Parent = SilentFovFrame local SilentTargetLine = newLineFrame(EspGui, 6) local function isSilentAimActive() if not isAlive() then return false end if Config.SilentAimKeyMode == "Hold" then return SilentKeyHeld end return Config.SilentAimEnabled end local function pickSilentPart(entry, camera, center) local mode = Config.SilentAimTargetPart if mode == "Head" then return entry.Head or entry.Torso elseif mode == "Torso" then return entry.Torso or entry.Head elseif mode == "Random" then local avail = {} for _, name in ipairs(SILENT_PARTS_LIST) do local p = entry.Limbs[name] if p and p.Parent then table.insert(avail, p) end end if #avail > 0 then return avail[math.random(1, #avail)] end return entry.Torso or entry.Head elseif mode == "Nearest Part" then local bestP, bestD = nil, math.huge for _, name in ipairs(SILENT_PARTS_LIST) do local p = entry.Limbs[name] if p and p.Parent then local vp = camera:WorldToViewportPoint(p.Position) if vp.Z > 0 then local d = (Vector2.new(vp.X, vp.Y) - center).Magnitude if d < bestD then bestD = d bestP = p end end end end return bestP or entry.Torso or entry.Head end return entry.Head or entry.Torso end local function pickSilentVisiblePartAndPoint(entry, camera, center, checkOrigin, baseIgnore) local mode = Config.SilentAimTargetPart if not Config.SilentAimVisibleOnly then local part = pickSilentPart(entry, camera, center) if part and part.Parent and isFiniteVec3(part.Position) then return part, part.Position end return nil, nil end if mode == "Nearest Part" then local candidates = {} for _, name in ipairs(SILENT_PARTS_LIST) do local p = entry.Limbs[name] if p and p.Parent and isFiniteVec3(p.Position) then local vp = camera:WorldToViewportPoint(p.Position) if vp.Z > 0 and isFiniteNum(vp.X) and isFiniteNum(vp.Y) then local d = (Vector2.new(vp.X, vp.Y) - center).Magnitude table.insert(candidates, { part = p, dist = d }) end end end table.sort(candidates, function(a, b) return a.dist < b.dist end) for i = 1, #candidates do local p = candidates[i].part if forVisualOnly and i > 2 then if isPointVisibleWithRay(checkOrigin, p.Position, entry.Model, SilentRayParams, baseIgnore) then return p, p.Position end else local pt = findVisiblePointOnPart(checkOrigin, p, entry.Model, SilentRayParams, baseIgnore, forVisualOnly) if pt then return p, pt end end end return nil, nil elseif mode == "Random" then local now = os.clock() if entry._randLimbName and entry._randLimbAt and (now - entry._randLimbAt) < 0.25 then local p = entry.Limbs[entry._randLimbName] if p and p.Parent and isFiniteVec3(p.Position) then local pt = findVisiblePointOnPart(checkOrigin, p, entry.Model, SilentRayParams, baseIgnore, forVisualOnly) if pt then return p, pt end end end local availNames = {} for _, name in ipairs(SILENT_PARTS_LIST) do local p = entry.Limbs[name] if p and p.Parent and isFiniteVec3(p.Position) then table.insert(availNames, name) end end for i = #availNames, 2, -1 do local j = math.random(1, i) availNames[i], availNames[j] = availNames[j], availNames[i] end for i = 1, #availNames do local name = availNames[i] local p = entry.Limbs[name] local pt = (forVisualOnly and i > 1) and (isPointVisibleWithRay(checkOrigin, p.Position, entry.Model, SilentRayParams, baseIgnore) and p.Position or nil) or findVisiblePointOnPart(checkOrigin, p, entry.Model, SilentRayParams, baseIgnore, forVisualOnly) if pt then entry._randLimbName = name entry._randLimbAt = now return p, pt end end return nil, nil end local primary = (mode == "Torso") and (entry.Torso or entry.Head) or (entry.Head or entry.Torso) if primary then local pt = findVisiblePointOnPart(checkOrigin, primary, entry.Model, SilentRayParams, baseIgnore, forVisualOnly) if pt then return primary, pt end end return nil, nil end local function resolveCachedSilentPart(entry, camera, center, checkOrigin, baseIgnore, now, forVisualOnly) if forVisualOnly then local cached = SilentVisCache[entry] local mode = Config.SilentAimTargetPart local visOnly = Config.SilentAimVisibleOnly if cached and (now - cached.t) < 0.05 and cached.mode == mode and cached.visOnly == visOnly then if not cached.ok then return nil, nil end local p = cached.part if p and p.Parent and isFiniteVec3(p.Position) then local pt = cached.localOffset and (p.CFrame * cached.localOffset) or p.Position if isFiniteVec3(pt) then return p, pt end end end local part, aimPt = pickSilentVisiblePartAndPoint(entry, camera, center, checkOrigin, baseIgnore, true) if part and isFiniteVec3(aimPt) then local okOff, localOff = pcall(function() return part.CFrame:PointToObjectSpace(aimPt) end) SilentVisCache[entry] = { t = now, ok = true, mode = mode, visOnly = visOnly, part = part, localOffset = (okOff and isFiniteVec3(localOff)) and localOff or Vector3.zero, } return part, aimPt end SilentVisCache[entry] = { t = now, ok = false, mode = mode, visOnly = visOnly, } return nil, nil end return pickSilentVisiblePartAndPoint(entry, camera, center, checkOrigin, baseIgnore, false) end local function getSilentAimTarget(camera, checkOrigin, refDir, forVisualOnly) if not camera or not isFiniteVec3(checkOrigin) then return nil, nil, nil, nil end local vpSize = camera.ViewportSize local center = Vector2.new(vpSize.X * 0.5, vpSize.Y * 0.5) local refUnit = (isFiniteVec3(refDir) and refDir.Magnitude > 1e-4) and refDir.Unit or camera.CFrame.LookVector local maxAngleDeg = math.clamp(tonumber(Config.SilentAimMaxAngle) or 22, 1, 180) local localTeamName = getLocalTeamName() local isLocalNeutral = (localTeamName == "Neutral") local fovLimit = Config.SilentAimFovRadius local preFovLimit = fovLimit + 70 local preAngleLimit = math.min(maxAngleDeg + 14, 180) local inFov = {} for model, entry in pairs(PlayerCache) do if model and model.Parent and not isEntryDead(entry) then local plr = entry.Player local targetTeamName = getEntryTeamInfo(entry, plr) local isNeutral = (targetTeamName == "Neutral") local isAlly = (not isLocalNeutral) and (not isNeutral) and (targetTeamName == localTeamName) if (not isAlly) and (not isNeutral) then local isUnc = entry.Unconscious and entry.Unconscious.Value == true or false if not (Config.SilentAimIgnoreUnconscious and isUnc) then local curHp = getCharacterHealth(entry) if curHp > 0 or isUnc then local approxPart = entry.Head or entry.Torso or entry.RootPart if approxPart and approxPart.Parent and isFiniteVec3(approxPart.Position) then local approxDelta = approxPart.Position - checkOrigin local approxMag = approxDelta.Magnitude if approxMag > 1e-4 and (approxMag * 0.28) <= (Config.SilentAimMaxDistance + 8) then local approxDeg = math.deg(math.acos(math.clamp(refUnit:Dot(approxDelta / approxMag), -1, 1))) if approxDeg <= preAngleLimit then local approxVp = camera:WorldToViewportPoint(approxPart.Position) if approxVp.Z > 0 and isFiniteNum(approxVp.X) and isFiniteNum(approxVp.Y) then local approxFovDist = (Vector2.new(approxVp.X, approxVp.Y) - center).Magnitude if approxFovDist <= preFovLimit then table.insert(inFov, { entry = entry, approxFov = approxFovDist }) end end end end end end end end end end if #inFov == 0 then return nil, nil, nil, nil end table.sort(inFov, function(a, b) return a.approxFov < b.approxFov end) local now = os.clock() local baseIgnore = buildRayIgnoreList(nil) local bestDist = fovLimit local bestEntry, bestPart, bestPoint, bestScreen = nil, nil, nil, nil for i = 1, #inFov do local cand = inFov[i] if cand.approxFov > (bestDist + 60) then break end local entry = cand.entry local part, aimPt = resolveCachedSilentPart(entry, camera, center, checkOrigin, baseIgnore, now, forVisualOnly) if part and isFiniteVec3(aimPt) then local toPart = aimPt - checkOrigin local rawMag = toPart.Magnitude if rawMag > 1e-4 and (rawMag * 0.28) <= Config.SilentAimMaxDistance then local deg = math.deg(math.acos(math.clamp(refUnit:Dot(toPart / rawMag), -1, 1))) if deg <= maxAngleDeg then local vp = camera:WorldToViewportPoint(aimPt) if vp.Z > 0 and isFiniteNum(vp.X) and isFiniteNum(vp.Y) then local sPos = Vector2.new(vp.X, vp.Y) local fovDist = (sPos - center).Magnitude if fovDist <= bestDist then bestDist = fovDist bestEntry = entry bestPart = part bestPoint = aimPt bestScreen = sPos end end end end end end return bestEntry, bestPart, bestPoint, bestScreen end local function solveSilentAimDirection(origin, targetPart, targetPoint, fireParams) local targetPos = isFiniteVec3(targetPoint) and targetPoint or (targetPart and targetPart.Position) if not isFiniteVec3(origin) or not isFiniteVec3(targetPos) then return nil end local wStats = fireParams and fireParams.Weapon local speed = (wStats and wStats.MuzzleSpeed) or (fireParams and fireParams.MuzzleSpeed) or 0 local gravity = (fireParams and fireParams.Gravity) or Workspace.Gravity local decay = math.max((wStats and wStats.K) or (fireParams and fireParams.K) or 0, 0) if not isFiniteNum(speed) then speed = 0 end if not isFiniteNum(gravity) then gravity = Workspace.Gravity end if not isFiniteNum(decay) then decay = 0 end if speed <= 10 then local d = targetPos - origin return d.Magnitude > 1e-4 and d.Unit or nil end local targetVel = Vector3.zero if Config.SilentAimPrediction and targetPart then local pVel = targetPart.AssemblyLinearVelocity if isFiniteVec3(pVel) and pVel.Magnitude < 250 then targetVel = pVel end end local aimPoint = targetPos for _ = 1, 2 do local dist = (aimPoint - origin).Magnitude local t if decay > 1e-6 and (dist * decay / speed) < 0.99 then t = -(1 / decay) * math.log(1 - dist * decay / speed) else t = dist / speed end if not isFiniteNum(t) then t = dist / speed end t = math.clamp(t, 0, 3.0) local predPos = targetPos + targetVel * t local dropOffset = Config.SilentAimDropComp and (0.5 * gravity * t * t) or 0 if not isFiniteNum(dropOffset) then dropOffset = 0 end local candidate = predPos + Vector3.new(0, dropOffset, 0) if not isFiniteVec3(candidate) then break end aimPoint = candidate end local finalDir = aimPoint - origin if not isFiniteVec3(finalDir) or finalDir.Magnitude <= 1e-4 then return nil end local unitDir = finalDir.Unit return isFiniteVec3(unitDir) and unitDir or nil end task.spawn(function() local ps = LocalPlayer:WaitForChild("PlayerScripts", 10) local bc = ps and ps:WaitForChild("BallisticsClient", 10) local cfInst = bc and bc:WaitForChild("ClientFire", 10) if not cfInst or not isAlive() then return end local ok, mod = pcall(require, cfInst) if not ok or type(mod) ~= "table" or type(mod.sLnpiWe6Dt) ~= "function" then return end ClientFireMod = mod OrigClientFireBatch = mod.sLnpiWe6Dt mod.sLnpiWe6Dt = function(a1, a2, a3, a4, a5, a6) local redirDirs = nil if isAlive() and isSilentAimActive() and type(a5) == "table" and #a5 > 0 and isFiniteVec3(a4) then local okSa, resDirs = pcall(function() local isVehicleShot = (type(a1) == "string") if isVehicleShot and not Config.SilentAimVehicles then return nil end if Config.SilentAimHitChance < 100 and math.random(1, 100) > Config.SilentAimHitChance then return nil end local cam = Workspace.CurrentCamera if not cam then return nil end local refDir = (isFiniteVec3(a5[1]) and a5[1].Magnitude > 1e-4) and a5[1].Unit or cam.CFrame.LookVector local _, part, aimPt = getSilentAimTarget(cam, a4, refDir) if not part or not aimPt then return nil end local fp = nil if WeaponSourceMod and type(WeaponSourceMod.toFireParams) == "function" then local okFp, resFp = pcall(WeaponSourceMod.toFireParams, { Tool = typeof(a1) == "Instance" and a1 or nil, WeaponName = type(a1) == "string" and a1 or nil, MuzzleIndex = a2, BulletIndex = a3, Owner = LocalPlayer, }) if okFp then fp = resFp end end local aimDir = solveSilentAimDirection(a4, part, aimPt, fp) if not isFiniteVec3(aimDir) or aimDir.Magnitude <= 0.9 then return nil end local maxAngleDeg = math.clamp(tonumber(Config.SilentAimMaxAngle) or 22, 1, 180) local out = table.create(#a5) local anyChanged = false for i = 1, #a5 do local orig = a5[i] if isFiniteVec3(orig) and orig.Magnitude > 1e-4 then local deg = math.deg(math.acos(math.clamp(orig.Unit:Dot(aimDir), -1, 1))) if deg <= maxAngleDeg then out[i] = aimDir anyChanged = true else out[i] = orig end else out[i] = orig end end return anyChanged and out or nil end) if okSa and type(resDirs) == "table" and #resDirs == #a5 then redirDirs = resDirs end end return OrigClientFireBatch(a1, a2, a3, a4, redirDirs or a5, a6) end end) connectSignal(RunService.RenderStepped, function() if not isAlive() then return end restoreCapability() local cam = Workspace.CurrentCamera if not cam then SilentFovFrame.Visible = false SilentTargetLine.Visible = false return end local active = isSilentAimActive() local vpSize = cam.ViewportSize local center = Vector2.new(vpSize.X * 0.5, vpSize.Y * 0.5) local showFov = Config.SilentAimShowFov and (Config.SilentAimEnabled or active) if showFov then local d = Config.SilentAimFovRadius * 2 SilentFovFrame.Position = UDim2.fromOffset(center.X, center.Y) SilentFovFrame.Size = UDim2.fromOffset(d, d) SilentFovStroke.Color = Config.SilentAimFovColor SilentFovStroke.Transparency = active and 0.15 or 0.65 SilentFovFrame.Visible = true else SilentFovFrame.Visible = false end if active and Config.SilentAimShowTarget then local _, _, _, sPos = getSilentAimTarget(cam, cam.CFrame.Position, cam.CFrame.LookVector, true) restoreCapability() if sPos then drawLine2D(SilentTargetLine, center, sPos, Color3.fromRGB(255, 85, 85), 1.8, 0.9) else SilentTargetLine.Visible = false end else SilentTargetLine.Visible = false end end) -- ========================== -- VEICULOS: HOOKS DE FISICA, MOTOR & TORRETA -- ========================== local function syncTurretSpeeds() local spdMult = (isAlive() and Config.VehModEnabled) and math.max(Config.TurretSpeedMult, 0.25) or 1 for tcfg, orig in pairs(OrigTurretCfgs) do tcfg.YawSpeed = orig.YawSpeed * spdMult tcfg.PitchSpeed = orig.PitchSpeed * spdMult end end local function applyEngineMods(eng) local cfg = eng.cfg if cfg and not OrigEngineCfgs[cfg] then OrigEngineCfgs[cfg] = { HorsepowerLimit = cfg.HorsepowerLimit, RedlineRPM = cfg.RedlineRPM, ShiftRPM = cfg.ShiftRPM, DirectionShiftTime = cfg.DirectionShiftTime, } end if not OrigEngineStates[eng] then OrigEngineStates[eng] = { torqueScale = eng.torqueScale or 7, } end local origS = OrigEngineStates[eng] local origC = cfg and OrigEngineCfgs[cfg] if not isAlive() or not Config.VehModEnabled then eng.torqueScale = origS.torqueScale if cfg and origC then cfg.HorsepowerLimit = origC.HorsepowerLimit cfg.RedlineRPM = origC.RedlineRPM cfg.ShiftRPM = origC.ShiftRPM cfg.DirectionShiftTime = origC.DirectionShiftTime end return end local boostMult = (Config.VehBoostEnabled and VehBoostKeyHeld) and math.max(Config.VehBoostMult, 1) or 1 eng.torqueScale = origS.torqueScale * math.max(Config.VehTorqueMult, 0.5) * boostMult if cfg and origC then if Config.VehUnlimitedHP then if origC.HorsepowerLimit then cfg.HorsepowerLimit = origC.HorsepowerLimit * 4 end else cfg.HorsepowerLimit = origC.HorsepowerLimit end local rpmScale = math.max(Config.VehTopSpeedMult * boostMult, Config.VehUnlimitedHP and 1.35 or 1) if origC.RedlineRPM then cfg.RedlineRPM = origC.RedlineRPM * rpmScale end if origC.ShiftRPM then cfg.ShiftRPM = origC.ShiftRPM * rpmScale end if Config.VehInstantShift then cfg.DirectionShiftTime = 0 eng.shiftCooldown = 0 else cfg.DirectionShiftTime = origC.DirectionShiftTime end end end local function getVehicleSpeedCapStuds() return math.max((tonumber(Config.VehSpeedLimit) or 80) / 1.008, 5) end local function applyWheelMods(drv) local wp = drv.wheelParams if not OrigWheelStates[drv] then OrigWheelStates[drv] = { topSpeed = drv.topSpeed or 55, dragK = drv.dragK or 0, maxSteer = drv.maxSteer or math.rad(24), steerSpeed = drv.steerSpeed or 5, steerReduction = drv.steerReduction or 0.45, Grip = wp and wp.Grip or 12, PeakGrip = wp and wp.PeakGrip or 1.2, SlideGrip = wp and wp.SlideGrip or 0.84, DriftGrip = wp and wp.DriftGrip or 40, BrakeMultiplier = wp and wp.BrakeMultiplier or 1, HandBrakeMultiplier = wp and wp.HandBrakeMultiplier or 9, } end local orig = OrigWheelStates[drv] if not isAlive() or not Config.VehModEnabled then drv.topSpeed = (isAlive() and Config.VehSpeedLimitEnabled) and math.min(orig.topSpeed, getVehicleSpeedCapStuds()) or orig.topSpeed drv.dragK = orig.dragK drv.maxSteer = orig.maxSteer drv.steerSpeed = orig.steerSpeed drv.steerReduction = orig.steerReduction if wp then wp.Grip = orig.Grip wp.PeakGrip = orig.PeakGrip wp.SlideGrip = orig.SlideGrip wp.DriftGrip = orig.DriftGrip wp.BrakeMultiplier = orig.BrakeMultiplier wp.HandBrakeMultiplier = orig.HandBrakeMultiplier end return end local boostMult = (Config.VehBoostEnabled and VehBoostKeyHeld) and math.max(Config.VehBoostMult, 1) or 1 local spdMult = math.max(Config.VehTopSpeedMult, 0.5) * boostMult local nextTop = orig.topSpeed * spdMult if Config.VehSpeedLimitEnabled then nextTop = math.min(nextTop, getVehicleSpeedCapStuds()) end drv.topSpeed = nextTop drv.dragK = Config.VehNoDrag and 0 or (orig.dragK / (spdMult * spdMult)) local stMult = math.max(Config.VehSteerMult, 0.5) drv.maxSteer = math.min(orig.maxSteer * stMult, math.rad(55)) drv.steerSpeed = orig.steerSpeed * stMult drv.steerReduction = stMult > 1.05 and math.max(orig.steerReduction * 0.45, 0) or orig.steerReduction if wp then local gMult = math.max(Config.VehGripMult, 0.5) wp.Grip = orig.Grip * gMult wp.PeakGrip = orig.PeakGrip * gMult wp.SlideGrip = orig.SlideGrip * gMult wp.DriftGrip = orig.DriftGrip * gMult local bMult = Config.VehStrongBrakes and 2.5 or 1 wp.BrakeMultiplier = orig.BrakeMultiplier * bMult wp.HandBrakeMultiplier = orig.HandBrakeMultiplier * bMult end end local function applyTrackMods(drv) if not OrigTrackStates[drv] then OrigTrackStates[drv] = { topSpeed = drv.topSpeed or 50, dragK = drv.dragK or 0, mu = drv.mu or 0.9, latMu = drv.latMu or 0.6, latGrip = drv.latGrip or 0.35, turnRate = drv.turnRate or math.rad(30), highSpeedShare = drv.highSpeedShare or 0.35, steerGain = drv.steerGain or 30, brakeDecel = drv.brakeDecel or 0.5, neutralSteer = drv.neutralSteer == true, pivotThrottle = drv.pivotThrottle or 0, } end local orig = OrigTrackStates[drv] if not isAlive() or not Config.VehModEnabled then drv.topSpeed = (isAlive() and Config.VehSpeedLimitEnabled) and math.min(orig.topSpeed, getVehicleSpeedCapStuds()) or orig.topSpeed drv.dragK = orig.dragK drv.mu = orig.mu drv.latMu = orig.latMu drv.latGrip = orig.latGrip drv.turnRate = orig.turnRate drv.highSpeedShare = orig.highSpeedShare drv.steerGain = orig.steerGain drv.brakeDecel = orig.brakeDecel drv.neutralSteer = orig.neutralSteer drv.pivotThrottle = orig.pivotThrottle return end local boostMult = (Config.VehBoostEnabled and VehBoostKeyHeld) and math.max(Config.VehBoostMult, 1) or 1 local spdMult = math.max(Config.VehTopSpeedMult, 0.5) * boostMult local nextTop = orig.topSpeed * spdMult if Config.VehSpeedLimitEnabled then nextTop = math.min(nextTop, getVehicleSpeedCapStuds()) end drv.topSpeed = nextTop drv.dragK = Config.VehNoDrag and 0 or (orig.dragK / (spdMult * spdMult)) local gMult = math.max(Config.VehGripMult, 0.5) drv.mu = orig.mu * gMult drv.latMu = orig.latMu * gMult drv.latGrip = orig.latGrip * gMult local stMult = math.max(Config.VehSteerMult, 0.5) drv.turnRate = orig.turnRate * stMult drv.steerGain = orig.steerGain * stMult drv.highSpeedShare = stMult > 1.05 and math.clamp(orig.highSpeedShare * stMult, 0, 1) or orig.highSpeedShare drv.brakeDecel = orig.brakeDecel * (Config.VehStrongBrakes and 2.5 or 1) if Config.VehNeutralSteer then drv.neutralSteer = true drv.pivotThrottle = math.max(orig.pivotThrottle, 0.65) else drv.neutralSteer = orig.neutralSteer drv.pivotThrottle = orig.pivotThrottle end end local function resolveVehicleRootModel(inst) local cur = inst while cur and cur ~= Workspace do if cur:IsA("Model") and cur:GetAttribute("VehicleNetId") ~= nil then local root = cur:FindFirstChild("RootPart") or cur.PrimaryPart or cur:FindFirstChildWhichIsA("BasePart") if root and root:IsA("BasePart") then return cur, root end end cur = cur.Parent end return nil, nil end local function getLocalDrivenVehicle() local ch = LocalPlayer.Character local hum = ch and ch:FindFirstChildOfClass("Humanoid") local seat = hum and hum.SeatPart if seat and seat:IsA("BasePart") then local veh, root = resolveVehicleRootModel(seat.Parent) if veh and root then return veh, root, seat end end if CurrentDrivenRoot and CurrentDrivenRoot.Parent and (os.clock() - LastActiveVehicleDriveAt) < 1.5 then local veh, root = resolveVehicleRootModel(CurrentDrivenRoot) if veh and root then return veh, root, seat end local parentMdl = CurrentDrivenRoot:FindFirstAncestorOfClass("Model") if parentMdl then return parentMdl, CurrentDrivenRoot, seat end end if ch then local seatNetId = ch:GetAttribute("SeatVehicleNetId") if seatNetId ~= nil then for model in pairs(VehicleCache) do if model and model.Parent and model:GetAttribute("VehicleNetId") == seatNetId then local root = model:FindFirstChild("RootPart") or model.PrimaryPart or model:FindFirstChildWhichIsA("BasePart") if root and root:IsA("BasePart") then return model, root, seat end end end end end return nil, nil, nil end local function uprightVehicleRoot(veh, root) local lv = root.CFrame.LookVector local flatFwd = Vector3.new(lv.X, 0, lv.Z) if flatFwd.Magnitude < 1e-3 then local rv = root.CFrame.RightVector flatFwd = Vector3.new(-rv.Z, 0, rv.X) end if flatFwd.Magnitude < 1e-3 then flatFwd = Vector3.new(0, 0, -1) else flatFwd = flatFwd.Unit end local liftY = 3.2 local ceilParams = RaycastParams.new() ceilParams.FilterType = Enum.RaycastFilterType.Exclude ceilParams.IgnoreWater = true local ign = { root } if veh then table.insert(ign, veh) end if LocalPlayer.Character then table.insert(ign, LocalPlayer.Character) end ceilParams.FilterDescendantsInstances = ign local ceilHit = Workspace:Raycast(root.Position, Vector3.new(0, 4.5, 0), ceilParams) if ceilHit then liftY = math.clamp((ceilHit.Position.Y - root.Position.Y) - 1.2, 0.5, 3.2) end local newPos = root.Position + Vector3.new(0, liftY, 0) root.AssemblyLinearVelocity = Vector3.zero root.AssemblyAngularVelocity = Vector3.zero root.CFrame = CFrame.lookAt(newPos, newPos + flatFwd) end local function flipCurrentVehicle() local veh, root = getLocalDrivenVehicle() if not veh or not root then return false, "Enter a vehicle first" end uprightVehicleRoot(veh, root) return true, veh.Name end task.spawn(function() local sharedVeh = ReplicatedStorage:WaitForChild("Shared", 10) sharedVeh = sharedVeh and sharedVeh:WaitForChild("Vehicle", 10) if not sharedVeh or not isAlive() then return end local okE, modE = pcall(require, sharedVeh:WaitForChild("Engine", 5)) if okE and type(modE) == "table" and type(modE.Update) == "function" and isAlive() then EngineMod = modE OrigEngineUpdate = modE.Update modE.Update = function(a1, a2, a3, a4, a5) if type(a1) == "table" then applyEngineMods(a1) end return OrigEngineUpdate(a1, a2, a3, a4, a5) end end local okW, modW = pcall(require, sharedVeh:WaitForChild("WheelDrive", 5)) if okW and type(modW) == "table" and type(modW.Update) == "function" and isAlive() then WheelDriveMod = modW OrigWheelDriveUpdate = modW.Update modW.Update = function(a1, a2, a3) if type(a1) == "table" then CurrentDrivenRoot = a1.root CurrentDrivenDrive = a1 LastActiveVehicleDriveAt = os.clock() applyWheelMods(a1) end return OrigWheelDriveUpdate(a1, a2, a3) end end local okT, modT = pcall(require, sharedVeh:WaitForChild("TrackDrive", 5)) if okT and type(modT) == "table" and type(modT.Update) == "function" and isAlive() then TrackDriveMod = modT OrigTrackDriveUpdate = modT.Update modT.Update = function(a1, a2, a3) if type(a1) == "table" then CurrentDrivenRoot = a1.root CurrentDrivenDrive = a1 LastActiveVehicleDriveAt = os.clock() applyTrackMods(a1) end return OrigTrackDriveUpdate(a1, a2, a3) end end local okTu, modTu = pcall(require, sharedVeh:WaitForChild("TurretController", 5)) if okTu and type(modTu) == "table" and isAlive() then TurretCtrlMod = modTu OrigTurretAttach = modTu.Attach OrigTurretApplyRecoil = modTu.ApplyRecoil if type(OrigTurretAttach) == "function" then modTu.Attach = function(a1, a2, a3) if type(a3) == "table" then for _, tc in pairs(a3) do if type(tc) == "table" and not OrigTurretCfgs[tc] then OrigTurretCfgs[tc] = { YawSpeed = tc.YawSpeed or 90, PitchSpeed = tc.PitchSpeed or 60, } end end syncTurretSpeeds() end return OrigTurretAttach(a1, a2, a3) end end if type(OrigTurretApplyRecoil) == "function" then modTu.ApplyRecoil = function(a1) if isAlive() and Config.VehModEnabled and Config.TurretNoRecoil then return end return OrigTurretApplyRecoil(a1) end end end local okVcm, vcm = pcall(function() return require(ReplicatedStorage:WaitForChild("Shared"):WaitForChild("VehicleConfigManager")) end) if okVcm and type(vcm) == "table" and type(vcm.GetAllVehicles) == "function" and isAlive() then local okAll, allVehs = pcall(vcm.GetAllVehicles) if okAll and type(allVehs) == "table" then for _, teamTbl in pairs(allVehs) do if type(teamTbl) == "table" then for _, catTbl in pairs(teamTbl) do if type(catTbl) == "table" then for _, vCfg in pairs(catTbl) do if type(vCfg) == "table" and type(vCfg.Turrets) == "table" then for _, tc in pairs(vCfg.Turrets) do if type(tc) == "table" and not OrigTurretCfgs[tc] then OrigTurretCfgs[tc] = { YawSpeed = tc.YawSpeed or 90, PitchSpeed = tc.PitchSpeed or 60, } end end end end end end end end syncTurretSpeeds() end end end) local VehFlippedSince = nil local LastAutoFlipAt = 0 connectSignal(RunService.Heartbeat, function(dt) if not isAlive() then return end if not (Config.VehModEnabled or Config.VehAntiFlip or Config.VehSpeedLimitEnabled) then VehFlippedSince = nil return end local veh, root, seat = getLocalDrivenVehicle() if not root or root.Anchored then VehFlippedSince = nil return end local now = os.clock() if Config.VehAntiFlip then local upY = root.CFrame.UpVector.Y if upY < 0.35 then VehFlippedSince = VehFlippedSince or now if (now - VehFlippedSince >= 0.45 or upY < -0.15) and (now - LastAutoFlipAt >= 1.0) then uprightVehicleRoot(veh, root) LastAutoFlipAt = now VehFlippedSince = nil else local upAxis = root.CFrame.UpVector:Cross(Vector3.yAxis) if upAxis.Magnitude <= 1e-3 then upAxis = root.CFrame.LookVector end if upAxis.Magnitude > 1e-3 then local ang = root.AssemblyAngularVelocity root.AssemblyAngularVelocity = ang:Lerp(upAxis.Unit * 7.5, math.clamp(dt * 10, 0, 1)) end end else VehFlippedSince = nil end else VehFlippedSince = nil end local hasThrottle = (seat and seat:IsA("VehicleSeat") and seat.ThrottleFloat > 0.1) or UserInputService:IsKeyDown(Enum.KeyCode.W) if Config.VehModEnabled and Config.VehBoostEnabled and VehBoostKeyHeld and hasThrottle then if (now - LastActiveVehicleDriveAt) < 0.35 then local maxSpd = (CurrentDrivenDrive and CurrentDrivenDrive.topSpeed or 70) * 1.15 if Config.VehSpeedLimitEnabled then maxSpd = math.min(maxSpd, getVehicleSpeedCapStuds()) end local flatLook = Vector3.new(root.CFrame.LookVector.X, 0, root.CFrame.LookVector.Z) if flatLook.Magnitude > 1e-3 then flatLook = flatLook.Unit local vel = root.AssemblyLinearVelocity local fwdSpeed = vel:Dot(flatLook) if fwdSpeed < maxSpd then local add = math.min(maxSpd - fwdSpeed, 55 * dt * math.max(Config.VehBoostMult, 1)) root.AssemblyLinearVelocity = vel + flatLook * add end end end end if Config.VehSpeedLimitEnabled then local capStuds = getVehicleSpeedCapStuds() local vel = root.AssemblyLinearVelocity local hSpd = math.sqrt(vel.X * vel.X + vel.Z * vel.Z) if hSpd > capStuds and isFiniteNum(hSpd) then local s = capStuds / hSpd root.AssemblyLinearVelocity = Vector3.new(vel.X * s, vel.Y, vel.Z * s) end end end) local function getBoundKeyName(widget, configKey) if widget and (not widget.Picking) and type(widget.Value) == "string" and widget.Value ~= "" and widget.Value ~= "..." then Config[configKey] = widget.Value end return Config[configKey] end local function doesInputMatchKey(input, boundKey) if type(boundKey) ~= "string" or boundKey == "" then return false end local ut = input.UserInputType if ut == Enum.UserInputType.Keyboard then return input.KeyCode ~= Enum.KeyCode.Unknown and input.KeyCode.Name == boundKey elseif ut == Enum.UserInputType.MouseButton1 then return boundKey == "MouseLeftButton" or boundKey == "MouseLeft" or boundKey == "MouseButton1" elseif ut == Enum.UserInputType.MouseButton2 then return boundKey == "MouseRightButton" or boundKey == "MouseRight" or boundKey == "MouseButton2" elseif ut == Enum.UserInputType.MouseButton3 then return boundKey == "MouseButton3" or boundKey == "MiddleMouse" end return false end connectSignal(UserInputService.InputBegan, function(input) if not isAlive() or UserInputService:GetFocusedTextBox() then return end if not (KeybindSilent and KeybindSilent.Picking) then local silentKey = getBoundKeyName(KeybindSilent, "SilentAimKey") if doesInputMatchKey(input, silentKey) then if Config.SilentAimKeyMode == "Toggle" then Config.SilentAimEnabled = not Config.SilentAimEnabled local reg = WidgetRegistry.SilentAimEnabled if reg and reg.obj then pcall(function() reg.obj:Set(Config.SilentAimEnabled) end) end elseif Config.SilentAimKeyMode == "Hold" then SilentKeyHeld = true end end end if not (KeybindBoost and KeybindBoost.Picking) then local boostKey = getBoundKeyName(KeybindBoost, "VehBoostKey") if doesInputMatchKey(input, boostKey) then VehBoostKeyHeld = true end end end) connectSignal(UserInputService.InputEnded, function(input) if doesInputMatchKey(input, getBoundKeyName(KeybindSilent, "SilentAimKey")) then SilentKeyHeld = false end if doesInputMatchKey(input, getBoundKeyName(KeybindBoost, "VehBoostKey")) then VehBoostKeyHeld = false end end) -- ========================== -- VISUAIS, AMBIENTE & CONTROLE DO CURSOR DO MENU -- ========================== local function initVisualsSystem() local MATERIAL_ENUM = { ForceField = Enum.Material.ForceField, Neon = Enum.Material.Neon, Glass = Enum.Material.Glass, SmoothPlastic = Enum.Material.SmoothPlastic, Metal = Enum.Material.Metal, Plastic = Enum.Material.Plastic, } local TIME_PRESETS = { Day = 14, Night = 0, Sunset = 18.25, Dawn = 6.25, } local function captureEnvOriginals() if VisualState.OrigEnvSaved then return end VisualState.OrigEnvSaved = true VisualState.OrigEnv = { ClockTime = Lighting.ClockTime, FogEnd = Lighting.FogEnd, FogStart = Lighting.FogStart, GlobalShadows = Lighting.GlobalShadows, Brightness = Lighting.Brightness, Ambient = Lighting.Ambient, OutdoorAmbient = Lighting.OutdoorAmbient, } end local function applyEnvironmentVisuals() if VisualState.TimeModified or VisualState.FogModified or VisualState.BrightModified or Config.VisualTimeEnabled or Config.VisualNoFog or Config.VisualFullBright then captureEnvOriginals() end if Config.VisualTimeEnabled then VisualState.TimeModified = true local t = TIME_PRESETS[Config.VisualTimePreset] if Config.VisualTimePreset == "Custom" or t == nil then t = tonumber(Config.VisualClockTime) or 14 end Lighting.ClockTime = math.clamp(t, 0, 24) elseif VisualState.TimeModified then VisualState.TimeModified = false Lighting.ClockTime = VisualState.OrigEnv.ClockTime end if Config.VisualNoFog then VisualState.FogModified = true Lighting.FogEnd = 1e6 Lighting.FogStart = 1e6 for _, child in ipairs(Lighting:GetChildren()) do if child:IsA("Atmosphere") then if not VisualState.OrigAtmos[child] then VisualState.OrigAtmos[child] = { Density = child.Density, Haze = child.Haze, Glare = child.Glare, } end child.Density = 0 child.Haze = 0 child.Glare = 0 end end elseif VisualState.FogModified then VisualState.FogModified = false Lighting.FogEnd = VisualState.OrigEnv.FogEnd Lighting.FogStart = VisualState.OrigEnv.FogStart for atmos, orig in pairs(VisualState.OrigAtmos) do if atmos and atmos.Parent then atmos.Density = orig.Density atmos.Haze = orig.Haze atmos.Glare = orig.Glare end end end if Config.VisualFullBright then VisualState.BrightModified = true Lighting.GlobalShadows = false Lighting.Brightness = 2.5 Lighting.Ambient = Color3.fromRGB(170, 170, 170) Lighting.OutdoorAmbient = Color3.fromRGB(170, 170, 170) elseif VisualState.BrightModified then VisualState.BrightModified = false Lighting.GlobalShadows = VisualState.OrigEnv.GlobalShadows Lighting.Brightness = VisualState.OrigEnv.Brightness Lighting.Ambient = VisualState.OrigEnv.Ambient Lighting.OutdoorAmbient = VisualState.OrigEnv.OutdoorAmbient end end local function isWeaponOpticGlass(part) if not VisualState.OrigParts[part] and part.Transparency >= 0.92 then return true end if part.Transparency > 0.05 then local lname = string.lower(part.Name) if string.find(lname, "lens", 1, true) or string.find(lname, "reticle", 1, true) or string.find(lname, "glass", 1, true) then return true end end return false end local function stylePart(part, color, matName, category) if not part:IsA("BasePart") or part.Name == "HumanoidRootPart" then return end if category ~= "char" and isWeaponOpticGlass(part) then return end if category == "char" and not VisualState.OrigParts[part] and part.Transparency >= 0.95 then return end local orig = VisualState.OrigParts[part] if not orig then orig = { category = category, Color = part.Color, Material = part.Material, MaterialVariant = part.MaterialVariant, TextureID = part:IsA("MeshPart") and part.TextureID or nil, meshes = {}, decals = {}, } VisualState.OrigParts[part] = orig end orig.category = category local matEnum = MATERIAL_ENUM[matName] or Enum.Material.ForceField part.Color = color part.Material = matEnum if part.MaterialVariant ~= "" then part.MaterialVariant = "" end if part:IsA("MeshPart") and part.TextureID ~= "" then part.TextureID = "" end for _, desc in ipairs(part:GetChildren()) do if desc:IsA("SurfaceAppearance") then VisualState.DetachedSurfaces[desc] = { parent = part, category = category } desc.Parent = nil elseif desc:IsA("SpecialMesh") then if not orig.meshes[desc] then orig.meshes[desc] = { TextureId = desc.TextureId, VertexColor = desc.VertexColor, } end desc.TextureId = "" desc.VertexColor = Vector3.new(color.R, color.G, color.B) elseif desc:IsA("Decal") or desc:IsA("Texture") then if orig.decals[desc] == nil then orig.decals[desc] = desc.Transparency end desc.Transparency = 1 end end end local function restorePart(part) local orig = VisualState.OrigParts[part] if not orig then return end VisualState.OrigParts[part] = nil if part and part.Parent then pcall(function() part.Color = orig.Color part.Material = orig.Material if orig.MaterialVariant ~= nil then part.MaterialVariant = orig.MaterialVariant end if orig.TextureID ~= nil and part:IsA("MeshPart") then part.TextureID = orig.TextureID end end) for mesh, mOrig in pairs(orig.meshes) do if mesh and mesh.Parent then pcall(function() mesh.TextureId = mOrig.TextureId mesh.VertexColor = mOrig.VertexColor end) end end for dec, dTrans in pairs(orig.decals) do if dec and dec.Parent then pcall(function() dec.Transparency = dTrans end) end end end end local function restoreCategory(targetCategory) for part, orig in pairs(VisualState.OrigParts) do if orig.category == targetCategory then restorePart(part) end end for sa, info in pairs(VisualState.DetachedSurfaces) do if info.category == targetCategory then VisualState.DetachedSurfaces[sa] = nil if sa and info.parent and info.parent.Parent then pcall(function() sa.Parent = info.parent end) end end end end local function styleClothing(obj, hide, category) local orig = VisualState.OrigClothes[obj] if hide then if not orig then if obj:IsA("Shirt") then orig = { category = category, prop = "ShirtTemplate", val = obj.ShirtTemplate } elseif obj:IsA("Pants") then orig = { category = category, prop = "PantsTemplate", val = obj.PantsTemplate } elseif obj:IsA("ShirtGraphic") then orig = { category = category, prop = "Graphic", val = obj.Graphic } end if orig then VisualState.OrigClothes[obj] = orig end end if orig then orig.category = category pcall(function() obj[orig.prop] = "" end) end elseif orig and orig.category == category then VisualState.OrigClothes[obj] = nil pcall(function() obj[orig.prop] = orig.val end) end end local function isViewmodelArmPart(part) if part:FindFirstAncestor("Handle") or part:FindFirstAncestorWhichIsA("Tool") then return false end return part.Name == "Left Arm" or part.Name == "Right Arm" or part:FindFirstAncestor("Left Arm") ~= nil or part:FindFirstAncestor("Right Arm") ~= nil end local function isViewmodelRigDummy(part) if part:FindFirstAncestor("Handle") or part:FindFirstAncestorWhichIsA("Tool") then return false end return part.Name == "Head" or part.Name == "Torso" or part.Name == "HumanoidRootPart" or part:FindFirstAncestor("Head") ~= nil or part:FindFirstAncestor("Torso") ~= nil end local function applyCharacterAndWeaponVisuals() local ch = LocalPlayer.Character -- 1. Personagem local (corpo, roupas e acessorios) if Config.VisualCharEnabled and ch and ch.Parent then for _, d in ipairs(ch:GetDescendants()) do if not d:FindFirstAncestorWhichIsA("Tool") then if d:IsA("BasePart") then stylePart(d, Config.VisualCharColor, Config.VisualCharMaterial, "char") elseif d:IsA("Shirt") or d:IsA("Pants") or d:IsA("ShirtGraphic") then styleClothing(d, Config.VisualCharHideClothes, "char") end end end else restoreCategory("char") for obj, orig in pairs(VisualState.OrigClothes) do if orig.category == "char" then styleClothing(obj, false, "char") end end end -- 2. Arma equipada em 3a pessoa + viewmodel em 1a pessoa if Config.VisualWeaponEnabled then if ch and ch.Parent then for _, child in ipairs(ch:GetChildren()) do if child:IsA("Tool") then for _, d in ipairs(child:GetDescendants()) do if d:IsA("BasePart") then stylePart(d, Config.VisualWeaponColor, Config.VisualWeaponMaterial, "weapon") end end end end end else restoreCategory("weapon") end local ign = Workspace:FindFirstChild("Ignore") if ign then for _, vm in ipairs(ign:GetChildren()) do if vm:IsA("Model") and string.sub(vm.Name, -9) == "Viewmodel" then for _, d in ipairs(vm:GetDescendants()) do if d:IsA("BasePart") then if isViewmodelArmPart(d) then if Config.VisualArmsEnabled then stylePart(d, Config.VisualArmsColor, Config.VisualArmsMaterial, "arms") end elseif not isViewmodelRigDummy(d) and Config.VisualWeaponEnabled then stylePart(d, Config.VisualWeaponColor, Config.VisualWeaponMaterial, "weapon") end elseif d:IsA("Shirt") or d:IsA("Pants") then styleClothing(d, Config.VisualArmsEnabled, "arms") end end end end end if not Config.VisualArmsEnabled then restoreCategory("arms") for obj, orig in pairs(VisualState.OrigClothes) do if orig.category == "arms" then styleClothing(obj, false, "arms") end end end end local function ensureMenuModalButton() if VisualState.MenuModalBtn and VisualState.MenuModalBtn.Parent then return VisualState.MenuModalBtn end local btn = Instance.new("TextButton") btn.Name = "GF_CursorUnlockModal" btn.Size = UDim2.fromOffset(0, 0) btn.Position = UDim2.fromOffset(0, 0) btn.BackgroundTransparency = 1 btn.Text = "" btn.AutoButtonColor = false btn.Active = false btn.Selectable = false btn.Modal = false btn.Visible = false btn.ZIndex = 0 btn.Parent = EspGui VisualState.MenuModalBtn = btn return btn end local function syncMenuCursor() local menuOpen = (not Unloaded) and (Window ~= nil) and (not Window.Closed) local btn = ensureMenuModalButton() if menuOpen then if not VisualState.MenuWasOpen then VisualState.SavedMouseBehavior = UserInputService.MouseBehavior VisualState.SavedMouseIconEnabled = UserInputService.MouseIconEnabled VisualState.MenuWasOpen = true end if btn then btn.Visible = true btn.Modal = true end UserInputService.MouseBehavior = Enum.MouseBehavior.Default UserInputService.MouseIconEnabled = true elseif VisualState.MenuWasOpen then VisualState.MenuWasOpen = false if btn then btn.Modal = false btn.Visible = false end if VisualState.SavedMouseBehavior ~= nil then pcall(function() UserInputService.MouseBehavior = VisualState.SavedMouseBehavior end) VisualState.SavedMouseBehavior = nil end if VisualState.SavedMouseIconEnabled ~= nil then pcall(function() UserInputService.MouseIconEnabled = VisualState.SavedMouseIconEnabled end) VisualState.SavedMouseIconEnabled = nil end end end local function updateFovVisual() local cam = Workspace.CurrentCamera if not cam then return end if Config.VisualFovEnabled then if not VisualState.FovModified then VisualState.OrigCameraFov = cam.FieldOfView VisualState.FovModified = true end cam.FieldOfView = math.clamp(tonumber(Config.VisualFov) or 85, 30, 120) elseif VisualState.FovModified then VisualState.FovModified = false cam.FieldOfView = VisualState.OrigCameraFov or 70 VisualState.OrigCameraFov = nil end end restoreAllVisuals = function() restoreCategory("char") restoreCategory("weapon") restoreCategory("arms") for obj, orig in pairs(VisualState.OrigClothes) do if obj and obj.Parent then pcall(function() obj[orig.prop] = orig.val end) end VisualState.OrigClothes[obj] = nil end if VisualState.OrigEnvSaved then if VisualState.TimeModified then pcall(function() Lighting.ClockTime = VisualState.OrigEnv.ClockTime end) end if VisualState.FogModified then pcall(function() Lighting.FogEnd = VisualState.OrigEnv.FogEnd Lighting.FogStart = VisualState.OrigEnv.FogStart end) for atmos, orig in pairs(VisualState.OrigAtmos) do if atmos and atmos.Parent then pcall(function() atmos.Density = orig.Density atmos.Haze = orig.Haze atmos.Glare = orig.Glare end) end end end if VisualState.BrightModified then pcall(function() Lighting.GlobalShadows = VisualState.OrigEnv.GlobalShadows Lighting.Brightness = VisualState.OrigEnv.Brightness Lighting.Ambient = VisualState.OrigEnv.Ambient Lighting.OutdoorAmbient = VisualState.OrigEnv.OutdoorAmbient end) end end local cam = Workspace.CurrentCamera if cam and VisualState.FovModified then pcall(function() cam.FieldOfView = VisualState.OrigCameraFov or 70 end) VisualState.FovModified = false end if VisualState.MenuModalBtn then pcall(function() VisualState.MenuModalBtn:Destroy() end) VisualState.MenuModalBtn = nil end if VisualState.MenuWasOpen then VisualState.MenuWasOpen = false if VisualState.SavedMouseBehavior ~= nil then pcall(function() UserInputService.MouseBehavior = VisualState.SavedMouseBehavior end) end if VisualState.SavedMouseIconEnabled ~= nil then pcall(function() UserInputService.MouseIconEnabled = VisualState.SavedMouseIconEnabled end) end end end connectSignal(LocalPlayer.CharacterAdded, function() VisualState.Dirty = true task.defer(function() VisualState.Dirty = true end) end) local ignFolder = Workspace:FindFirstChild("Ignore") if ignFolder then connectSignal(ignFolder.ChildAdded, function() VisualState.Dirty = true task.defer(function() VisualState.Dirty = true end) end) end connectSignal(RunService.RenderStepped, function() if not isAlive() then return end syncMenuCursor() updateFovVisual() local now = os.clock() local anyEnv = Config.VisualTimeEnabled or Config.VisualNoFog or Config.VisualFullBright local anyModelVis = Config.VisualCharEnabled or Config.VisualWeaponEnabled or Config.VisualArmsEnabled if VisualState.Dirty or anyEnv then applyEnvironmentVisuals() end if VisualState.Dirty or (anyModelVis and (now - VisualState.LastVisualSync) >= 0.06) then VisualState.Dirty = false VisualState.LastVisualSync = now applyCharacterAndWeaponVisuals() end end) end initVisualsSystem() -- ========================== -- INTERFACE WINDUI (MINIMALIST ENGLISH) -- ========================== Window = WindUI:CreateWindow({ Title = "Cold War", Icon = "crosshair", Author = "Minimal", Folder = "GuerraFriaHub", Size = UDim2.fromOffset(620, 500), MinSize = Vector2.new(540, 380), MaxSize = Vector2.new(860, 650), Transparent = true, Theme = "Dark", Resizable = true, SideBarWidth = 165, ToggleKey = Enum.KeyCode[Config.MenuKey] or Enum.KeyCode.Insert, IgnoreAlerts = true, OpenButton = { Title = "Menu", Icon = "crosshair", OnlyMobile = false, Enabled = true, Draggable = true, }, }) local function buildMenuUI() local TabESP = Window:Tab({ Title = "ESP", Icon = "eye" }) local TabColors = Window:Tab({ Title = "Colors", Icon = "palette" }) local TabWeapon = Window:Tab({ Title = "Weapon", Icon = "wrench" }) local TabSilent = Window:Tab({ Title = "Silent Aim", Icon = "crosshair" }) local TabBallistics = Window:Tab({ Title = "Ballistics", Icon = "target" }) local TabVehicles = Window:Tab({ Title = "Vehicles", Icon = "truck" }) local TabVisuals = Window:Tab({ Title = "Visuals", Icon = "sun" }) local TabConfig = Window:Tab({ Title = "Config", Icon = "settings" }) local function addToggle(tab, key, title, onChange) local w = tab:Toggle({ Title = title, Value = Config[key], Callback = function(val) Config[key] = val if onChange then onChange(val) end end, }) registerWidget(key, "Toggle", w) return w end local function addSlider(tab, key, title, minV, maxV, step, onChange) local w = tab:Slider({ Title = title, Value = { Min = minV, Max = maxV, Default = Config[key] }, Step = step, Callback = function(val) Config[key] = val if onChange then onChange(val) end end, }) registerWidget(key, "Slider", w) return w end local function addDropdown(tab, key, title, values, onChange) local w = tab:Dropdown({ Title = title, Values = values, Value = Config[key], Callback = function(val) Config[key] = val if onChange then onChange(val) end end, }) registerWidget(key, "Dropdown", w) return w end local function addColor(tab, key, title, onChange) local w = tab:Colorpicker({ Title = title, Default = Config[key], Callback = function(col) Config[key] = col if onChange then onChange(col) end end, }) registerWidget(key, "Colorpicker", w) return w end local function markVisualsDirty() VisualState.Dirty = true end -- TAB 1: ESP local SecFilters = TabESP:Section({ Title = "Filters", Opened = true }) addToggle(SecFilters, "Enabled", "Enable") addToggle(SecFilters, "ShowEnemies", "Enemies") addToggle(SecFilters, "ShowAllies", "Allies") addToggle(SecFilters, "ShowNeutral", "Neutral") addToggle(SecFilters, "IgnoreUnconscious", "Ignore Downed") addToggle(SecFilters, "UseVisibilityCheck", "Visible Check") addSlider(SecFilters, "MaxDistance", "Max Distance", 50, 3000, 25) addDropdown(SecFilters, "DistanceUnit", "Unit", { "Meters", "Studs" }) local SecBox = TabESP:Section({ Title = "Box & Skeleton", Opened = true }) addDropdown(SecBox, "BoxMode", "Box Style", { "Corners", "2D Full", "3D Box", "Off" }) addSlider(SecBox, "BoxThickness", "Box Thickness", 0.5, 4, 0.5) addSlider(SecBox, "BoxTransparency", "Box Opacity", 0.1, 1, 0.05) addToggle(SecBox, "BoxOutline", "Box Outline") addToggle(SecBox, "BoxFill", "Box Fill") addSlider(SecBox, "BoxFillTransparency", "Fill Opacity", 0.05, 0.8, 0.05) addToggle(SecBox, "SkeletonEnabled", "Skeleton") addSlider(SecBox, "SkeletonThickness", "Line Thickness", 0.5, 4, 0.1) addSlider(SecBox, "SkeletonTransparency", "Line Opacity", 0.1, 1, 0.05) local SecInfo = TabESP:Section({ Title = "Health & Info", Opened = true }) addToggle(SecInfo, "HealthBarEnabled", "Health Bar") addDropdown(SecInfo, "HealthMode", "Health Mode", { "Torso", "Limbs Total", "Vital (Head+Torso)" }) addSlider(SecInfo, "HealthBarWidth", "Bar Width", 2, 6, 1) addToggle(SecInfo, "HealthTextEnabled", "Health Text") addToggle(SecInfo, "ShockBarEnabled", "Shock Bar") addToggle(SecInfo, "NameEnabled", "Name") addToggle(SecInfo, "TeamTagEnabled", "Team Tag") addToggle(SecInfo, "UseDisplayName", "Display Name") addToggle(SecInfo, "DistanceEnabled", "Distance") addToggle(SecInfo, "WeaponEnabled", "Weapon") addToggle(SecInfo, "ClassEnabled", "Class") addToggle(SecInfo, "StanceEnabled", "Stance") addSlider(SecInfo, "TextSize", "Text Size", 10, 20, 1) addDropdown(SecInfo, "TextFont", "Font", { "Code", "Gotham", "SourceSans", "RobotoMono" }) addToggle(SecInfo, "TextOutline", "Text Outline") local SecTracers = TabESP:Section({ Title = "Tracers & Chams", Opened = false }) addToggle(SecTracers, "TracerEnabled", "Tracers") addDropdown(SecTracers, "TracerOrigin", "Origin", { "Bottom", "Center", "Top", "Mouse" }) addDropdown(SecTracers, "TracerTarget", "Target", { "Feet", "Center", "Head" }) addSlider(SecTracers, "TracerThickness", "Thickness", 0.5, 4, 0.1) addSlider(SecTracers, "TracerTransparency", "Opacity", 0.1, 1, 0.05) addToggle(SecTracers, "ChamsEnabled", "Chams") addDropdown(SecTracers, "ChamsDepthMode", "Depth Mode", { "AlwaysOnTop", "Occluded" }) addSlider(SecTracers, "ChamsFillTransparency", "Fill Alpha", 0, 1, 0.05) addSlider(SecTracers, "ChamsOutlineTransparency", "Outline Alpha", 0, 1, 0.05) -- TAB 2: Colors local SecTeamColors = TabColors:Section({ Title = "Teams", Opened = true }) addDropdown(SecTeamColors, "ColorMode", "Color Mode", { "Enemy / Ally", "Team Color (Auto)" }) addToggle(SecTeamColors, "HighlightUnconsciousColor", "Downed Highlight") addColor(SecTeamColors, "EnemyVisibleColor", "Enemy Visible") addColor(SecTeamColors, "EnemyOccludedColor", "Enemy Occluded") addColor(SecTeamColors, "AllyColor", "Ally") addColor(SecTeamColors, "NeutralColor", "Neutral") addColor(SecTeamColors, "UnconsciousColor", "Downed") local SecElemColors = TabColors:Section({ Title = "Custom", Opened = true }) addToggle(SecElemColors, "BoxUseCustomColor", "Custom Box") addColor(SecElemColors, "BoxCustomColor", "Box Color") addToggle(SecElemColors, "SkeletonUseCustomColor", "Custom Skeleton") addColor(SecElemColors, "SkeletonCustomColor", "Skeleton Color") addToggle(SecElemColors, "TextUseCustomColor", "Custom Text") addColor(SecElemColors, "TextCustomColor", "Text Color") addToggle(SecElemColors, "TracerUseCustomColor", "Custom Tracer") addColor(SecElemColors, "TracerCustomColor", "Tracer Color") addToggle(SecElemColors, "ChamsUseCustomColor", "Custom Chams") addColor(SecElemColors, "ChamsFillColor", "Chams Fill") addColor(SecElemColors, "ChamsOutlineColor", "Chams Outline") local SecHpColors = TabColors:Section({ Title = "Bars", Opened = false }) addColor(SecHpColors, "HealthFullColor", "Full HP") addColor(SecHpColors, "HealthMidColor", "Mid HP") addColor(SecHpColors, "HealthLowColor", "Low HP") addColor(SecHpColors, "ShockColor", "Shock") -- TAB 3: Weapon local SecRecoil = TabWeapon:Section({ Title = "Recoil", Opened = true }) addToggle(SecRecoil, "NoRecoil", "No Recoil") addSlider(SecRecoil, "RecoilPercent", "Recoil (%)", 0, 100, 5) local SecSway = TabWeapon:Section({ Title = "Sway", Opened = true }) addToggle(SecSway, "NoBreathSway", "No Sway") addSlider(SecSway, "BreathSwayPercent", "Sway (%)", 0, 100, 5) -- TAB 4: Silent Aim local SecSilentMain = TabSilent:Section({ Title = "Aim", Opened = true }) addToggle(SecSilentMain, "SilentAimEnabled", "Enable") KeybindSilent = SecSilentMain:Keybind({ Title = "Keybind", Value = Config.SilentAimKey, Callback = function() end, }) registerWidget("SilentAimKey", "Keybind", KeybindSilent) pcall(function() local lbl = KeybindSilent.UIElements.Keybind.Frame.Frame.TextLabel connectSignal(lbl:GetPropertyChangedSignal("Text"), function() local txt = lbl.Text if type(txt) == "string" and txt ~= "" and txt ~= "..." then Config.SilentAimKey = txt end end) end) addDropdown(SecSilentMain, "SilentAimKeyMode", "Key Mode", { "Toggle", "Hold", "Always On" }) addDropdown(SecSilentMain, "SilentAimTargetPart", "Target Part", { "Head", "Torso", "Nearest Part", "Random" }) addSlider(SecSilentMain, "SilentAimHitChance", "Hit Chance (%)", 10, 100, 5) local SecSilentFov = TabSilent:Section({ Title = "FOV & Filters", Opened = true }) addToggle(SecSilentFov, "SilentAimShowFov", "FOV Circle") addSlider(SecSilentFov, "SilentAimFovRadius", "FOV Radius", 25, 600, 5) addSlider(SecSilentFov, "SilentAimMaxAngle", "Max Angle", 2, 45, 1) addColor(SecSilentFov, "SilentAimFovColor", "FOV Color") addToggle(SecSilentFov, "SilentAimShowTarget", "Target Line") addSlider(SecSilentFov, "SilentAimMaxDistance", "Max Distance", 50, 2500, 25) addToggle(SecSilentFov, "SilentAimVisibleOnly", "Visible Check") addToggle(SecSilentFov, "SilentAimIgnoreUnconscious", "Ignore Downed") local SecSilentBall = TabSilent:Section({ Title = "Prediction", Opened = true }) addToggle(SecSilentBall, "SilentAimDropComp", "Drop Comp") addToggle(SecSilentBall, "SilentAimPrediction", "Movement Pred") addToggle(SecSilentBall, "SilentAimVehicles", "Vehicle Turrets") -- TAB 5: Ballistics local SecTrail = TabBallistics:Section({ Title = "Bullet Trail", Opened = true }) addToggle(SecTrail, "BulletTrailEnabled", "Show Trail") addToggle(SecTrail, "BulletTrail3D", "3D Beam") addSlider(SecTrail, "BulletTrailDuration", "Duration (s)", 0.5, 10, 0.5) addSlider(SecTrail, "BulletTrailThickness", "Thickness", 0.5, 5, 0.5) addColor(SecTrail, "BulletTrailColor", "Color") addToggle(SecTrail, "BulletImpactMarker", "Impact Marker") addColor(SecTrail, "BulletImpactColor", "Map Color") addColor(SecTrail, "BulletImpactHitColor", "Hit Color") local SecPreview = TabBallistics:Section({ Title = "Preview", Opened = true }) addToggle(SecPreview, "BulletPreviewEnabled", "Enable Preview") addToggle(SecPreview, "BulletPreviewOnlyADS", "ADS Only") addSlider(SecPreview, "BulletPreviewThickness", "Thickness", 0.5, 4, 0.2) addColor(SecPreview, "BulletPreviewColor", "Color") addColor(SecPreview, "BulletPreviewTargetColor", "Target Color") -- TAB 6: Vehicles local SecVehMod = TabVehicles:Section({ Title = "Handling", Opened = true }) local TogVehMod = SecVehMod:Toggle({ Title = "Enable", Value = Config.VehModEnabled, Callback = function(val) Config.VehModEnabled = val syncTurretSpeeds() end, }) registerWidget("VehModEnabled", "Toggle", TogVehMod) addSlider(SecVehMod, "VehTopSpeedMult", "Top Speed", 1.0, 3.0, 0.1) addToggle(SecVehMod, "VehNoDrag", "No Drag") addSlider(SecVehMod, "VehTorqueMult", "Torque", 1.0, 4.0, 0.2) addToggle(SecVehMod, "VehUnlimitedHP", "Unlimited HP") addToggle(SecVehMod, "VehInstantShift", "Instant Shift") addSlider(SecVehMod, "VehGripMult", "Grip", 1.0, 3.0, 0.1) addSlider(SecVehMod, "VehSteerMult", "Steering", 1.0, 2.5, 0.1) addToggle(SecVehMod, "VehStrongBrakes", "Strong Brakes") addToggle(SecVehMod, "VehNeutralSteer", "Neutral Steer") local SecVehUtil = TabVehicles:Section({ Title = "Utility", Opened = true }) addToggle(SecVehUtil, "VehBoostEnabled", "Boost") KeybindBoost = SecVehUtil:Keybind({ Title = "Boost Key", Value = Config.VehBoostKey, Callback = function() end, }) registerWidget("VehBoostKey", "Keybind", KeybindBoost) pcall(function() local lbl = KeybindBoost.UIElements.Keybind.Frame.Frame.TextLabel connectSignal(lbl:GetPropertyChangedSignal("Text"), function() local txt = lbl.Text if type(txt) == "string" and txt ~= "" and txt ~= "..." then Config.VehBoostKey = txt end end) end) addSlider(SecVehUtil, "VehBoostMult", "Boost Power", 1.2, 2.5, 0.1) addToggle(SecVehUtil, "VehSpeedLimitEnabled", "Speed Limiter") addSlider(SecVehUtil, "VehSpeedLimit", "Max Speed (km/h)", 10, 250, 5) addToggle(SecVehUtil, "VehAntiFlip", "Auto Flip") SecVehUtil:Button({ Title = "Flip Vehicle", Icon = "rotate-ccw", Callback = function() local ok, info = flipCurrentVehicle() WindUI:Notify({ Title = ok and "Flipped" or "Notice", Content = tostring(info), Duration = 2 }) end, }) local SecVehTurret = TabVehicles:Section({ Title = "Turret", Opened = true }) local SldTurretSpd = SecVehTurret:Slider({ Title = "Turret Speed", Value = { Min = 1.0, Max = 4.0, Default = Config.TurretSpeedMult }, Step = 0.25, Callback = function(val) Config.TurretSpeedMult = val syncTurretSpeeds() end, }) registerWidget("TurretSpeedMult", "Slider", SldTurretSpd) addToggle(SecVehTurret, "TurretNoRecoil", "No Recoil") local SecVeh = TabVehicles:Section({ Title = "Vehicle ESP", Opened = false }) addToggle(SecVeh, "VehicleEspEnabled", "Enable") addDropdown(SecVeh, "VehicleFilter", "Filter", { "All", "Enemy Only", "Ally Only" }) addToggle(SecVeh, "VehicleUseTeamColor", "Team Color") addColor(SecVeh, "VehicleColor", "Color") addSlider(SecVeh, "VehicleMaxDistance", "Max Distance", 100, 4000, 50) -- TAB 7: Visuals local MatList = { "ForceField", "Neon", "Glass", "SmoothPlastic", "Metal", "Plastic" } local SecWorld = TabVisuals:Section({ Title = "World", Opened = true }) addToggle(SecWorld, "VisualTimeEnabled", "Time Override", markVisualsDirty) addDropdown(SecWorld, "VisualTimePreset", "Time Preset", { "Day", "Night", "Sunset", "Dawn", "Custom" }, function(val) local map = { Day = 14, Night = 0, Sunset = 18.25, Dawn = 6.25 } if map[val] then Config.VisualClockTime = map[val] local reg = WidgetRegistry.VisualClockTime if reg and reg.obj then pcall(function() reg.obj:Set(Config.VisualClockTime) end) end end markVisualsDirty() end) addSlider(SecWorld, "VisualClockTime", "Clock Time", 0, 24, 0.25, function() if Config.VisualTimePreset ~= "Custom" then Config.VisualTimePreset = "Custom" local reg = WidgetRegistry.VisualTimePreset if reg and reg.obj then pcall(function() reg.obj:Select("Custom") end) end end markVisualsDirty() end) addToggle(SecWorld, "VisualNoFog", "No Fog", markVisualsDirty) addToggle(SecWorld, "VisualFullBright", "FullBright", markVisualsDirty) local SecCam = TabVisuals:Section({ Title = "Camera", Opened = true }) addToggle(SecCam, "VisualFovEnabled", "Override FOV") addSlider(SecCam, "VisualFov", "Field of View", 30, 120, 1) local SecChar = TabVisuals:Section({ Title = "Character", Opened = true }) addToggle(SecChar, "VisualCharEnabled", "Character Chams", markVisualsDirty) addColor(SecChar, "VisualCharColor", "Color", markVisualsDirty) addDropdown(SecChar, "VisualCharMaterial", "Material", MatList, markVisualsDirty) addToggle(SecChar, "VisualCharHideClothes", "Hide Clothes", markVisualsDirty) local SecVM = TabVisuals:Section({ Title = "Weapon & Viewmodel", Opened = true }) addToggle(SecVM, "VisualWeaponEnabled", "Weapon Chams", markVisualsDirty) addColor(SecVM, "VisualWeaponColor", "Weapon Color", markVisualsDirty) addDropdown(SecVM, "VisualWeaponMaterial", "Weapon Material", MatList, markVisualsDirty) addToggle(SecVM, "VisualArmsEnabled", "Arm Chams", markVisualsDirty) addColor(SecVM, "VisualArmsColor", "Arm Color", markVisualsDirty) addDropdown(SecVM, "VisualArmsMaterial", "Arm Material", MatList, markVisualsDirty) -- TAB 8: Config local SecUI = TabConfig:Section({ Title = "Menu", Opened = true }) local KeybindWidget = SecUI:Keybind({ Title = "Menu Key", Value = Config.MenuKey, Callback = function() end, }) registerWidget("MenuKey", "Keybind", KeybindWidget) pcall(function() local lbl = KeybindWidget.UIElements.Keybind.Frame.Frame.TextLabel connectSignal(lbl:GetPropertyChangedSignal("Text"), function() local txt = lbl.Text if type(txt) == "string" and txt ~= "" and txt ~= "..." then Config.MenuKey = txt if Window and Enum.KeyCode[txt] then pcall(function() Window:SetToggleKey(Enum.KeyCode[txt]) end) end end end) end) SecUI:Button({ Title = "Save Config", Icon = "save", Callback = function() if type(writefile) ~= "function" then WindUI:Notify({ Title = "Error", Content = "writefile unavailable", Duration = 2.5 }) return end local ok, err = pcall(writefile, ConfigPath, serializeConfig()) WindUI:Notify({ Title = ok and "Saved" or "Error", Content = ok and ConfigPath or tostring(err), Duration = 2 }) end, }) SecUI:Button({ Title = "Load Config", Icon = "folder-open", Callback = function() if type(isfile) ~= "function" or type(readfile) ~= "function" then WindUI:Notify({ Title = "Error", Content = "readfile unavailable", Duration = 2.5 }) return end if not isfile(ConfigPath) then WindUI:Notify({ Title = "Missing", Content = ConfigPath, Duration = 2 }) return end local ok, msg = applyConfigFromJson(readfile(ConfigPath)) WindUI:Notify({ Title = ok and "Loaded" or "Error", Content = ok and ConfigPath or tostring(msg), Duration = 2 }) end, }) SecUI:Button({ Title = "Unload", Icon = "power", Color = Color3.fromRGB(220, 65, 65), Callback = function() runFullCleanup() end, }) end buildMenuUI() VisualState.Dirty = true -- Auto-load saved config if type(isfile) == "function" and type(readfile) == "function" and isfile(ConfigPath) then pcall(function() applyConfigFromJson(readfile(ConfigPath)) end) end pcall(function() Window:SelectTab(1) end) WindUI:Notify({ Title = "Cold War", Content = "Loaded (" .. tostring(Config.MenuKey) .. ")", Duration = 3, })