-- [[ SERVICES ]] -- local Players = game:GetService("Players") local RunService = game:GetService("RunService") local UIS = game:GetService("UserInputService") local Workspace = game:GetService("Workspace") local SoundService = game:GetService("SoundService") local ReplicatedStorage = game:GetService("ReplicatedStorage") local Lighting = game:GetService("Lighting") local player = Players.LocalPlayer local Camera = Workspace.CurrentCamera --------------------------- -- CONFIG & GLOBALS --------------------------- local ScriptEnabled = true local AimbotEnabled = true local AimbotRange = 1000 local PredictionFactor = 0.07 local MouseFOVRadius = 120 local AimSmoothness = 0.03 local TargetBlueOnly = false local speedMultiplier = 0.001 local speedEnabled = false local inputVector = Vector3.new(0, 0, 0) local toggle = false local blueNames = {} -- FIX: activeTags was missing, causing the ESP crash! local activeTags = {} _G.OutlineTransparency = 0.9 _G.FillTransparency = 1 local HoldingRMB = false local Attacking = nil local previousMouseBehavior = Enum.MouseBehavior.Default local IsLocked = false local LastTargetPosition = nil local LastTargetVelocity = nil -- OPTIMIZE: precomputed constants local VEC_UP = Vector3.yAxis local VEC_DOWN = -Vector3.yAxis -- OPTIMIZE: cached services / references local CharStats = ReplicatedStorage:FindFirstChild("CharStats") local charsFolder = Workspace:FindFirstChild("Characters") local playerName = player.Name -- OPTIMIZE: cache the PlayerGui local playerGui = player:WaitForChild("PlayerGui") --------------------------- -- UTILITY (OPTIMIZED) --------------------------- local function isCharDisabledByName(name) local stats = CharStats if not stats then stats = ReplicatedStorage:FindFirstChild("CharStats") CharStats = stats if not stats then return false end end local pstats = stats:FindFirstChild(name) if not pstats then return false end local d = pstats:FindFirstChild("Downed") if d and d.Value then return true end local g = pstats:FindFirstChild("Grabbed") if g and g.Value then return true end local rt = pstats:FindFirstChild("RagdollTime") local rs = rt and rt:FindFirstChild("RagdollSwitch") if rs and rs.Value then return true end return false end local function isCharacterDisabled() return isCharDisabledByName(playerName) end --------------------------- -- FULLBRIGHT (OPTIMIZED) --------------------------- local fbEnabled = false local fbConnection = nil local lightingBackup = {children = {}, props = {}} local function applyFullBright() lightingBackup.props = { Ambient = Lighting.Ambient, OutdoorAmbient = Lighting.OutdoorAmbient, Brightness = Lighting.Brightness, ClockTime = Lighting.ClockTime, FogEnd = Lighting.FogEnd, GlobalShadows = Lighting.GlobalShadows, ExposureCompensation = Lighting.ExposureCompensation, EnvironmentDiffuseScale = Lighting.EnvironmentDiffuseScale, EnvironmentSpecularScale = Lighting.EnvironmentSpecularScale, GeographicLatitude = Lighting.GeographicLatitude, } for _, child in ipairs(Lighting:GetChildren()) do if child:IsA("PostEffect") or child:IsA("Atmosphere") or child:IsA("Sky") or child:IsA("Clouds") then lightingBackup.children[#lightingBackup.children + 1] = child child.Parent = nil end end Lighting.Brightness = 3 Lighting.ClockTime = 12 Lighting.GeographicLatitude = 41.7 Lighting.FogEnd = 1e5 Lighting.GlobalShadows = false Lighting.ExposureCompensation = 0.5 Lighting.Ambient = Color3.new(1, 1, 1) Lighting.OutdoorAmbient = Color3.new(1, 1, 1) Lighting.EnvironmentDiffuseScale = 1 Lighting.EnvironmentSpecularScale = 0 fbConnection = Lighting.ChildAdded:Connect(function(child) if child:IsA("PostEffect") or child:IsA("Atmosphere") or child:IsA("Sky") then task.defer(function() if fbEnabled then child.Parent = nil end end) end end) end local function restoreLighting() for prop, val in pairs(lightingBackup.props) do Lighting[prop] = val end for _, child in ipairs(lightingBackup.children) do if child and child.Parent == nil then child.Parent = Lighting end end lightingBackup.children = {} end local function toggleFullBright() fbEnabled = not fbEnabled if fbEnabled then applyFullBright() else if fbConnection then fbConnection:Disconnect() fbConnection = nil end restoreLighting() end end --------------------------- -- MONEY ESP (OPTIMIZED) --------------------------- local moneyActive = false local moneyTags = {} -- [obj] = billboard local moneyContainer = Workspace:WaitForChild("Map"):WaitForChild("BredMakurz") local function updateMoneyTag(obj) local values = obj:FindFirstChild("Values") local broken = values and values:FindFirstChild("Broken") if not moneyActive or (broken and broken.Value) then local t = moneyTags[obj] if t then t:Destroy() moneyTags[obj] = nil end return end if not moneyTags[obj] then local bb = Instance.new("BillboardGui") bb.Name = "MoneyTag" bb.Adornee = obj bb.Size = UDim2.new(0, 60, 0, 30) bb.StudsOffset = Vector3.new(0, 2.5, 0) bb.AlwaysOnTop = true local tl = Instance.new("TextLabel") tl.Size = UDim2.fromScale(1, 1) tl.BackgroundTransparency = 1 tl.Text = "MONEY" tl.TextColor3 = Color3.fromRGB(0, 255, 100) tl.Font = Enum.Font.GothamBold tl.TextScaled = true tl.Parent = bb bb.Parent = obj moneyTags[obj] = bb if broken then broken:GetPropertyChangedSignal("Value"):Connect(function() if broken.Value then updateMoneyTag(obj) end end) end end end local function clearMoneyTags() for _, tag in pairs(moneyTags) do tag:Destroy() end moneyTags = {} end --------------------------- -- UI FRAMEWORK --------------------------- local Theme = { Main = Color3.fromRGB(15, 18, 26), Header = Color3.fromRGB(25, 30, 45), Accent = Color3.fromRGB(0, 120, 255), Text = Color3.fromRGB(230, 230, 230), Button = Color3.fromRGB(30, 35, 50), On = Color3.fromRGB(0, 200, 120), Off = Color3.fromRGB(220, 60, 60), } local screenGui = Instance.new("ScreenGui") screenGui.Name = "MidnightCheatUI" screenGui.ResetOnSpawn = false screenGui.IgnoreGuiInset = true screenGui.Parent = playerGui local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 250, 0, 0) mainFrame.Position = UDim2.new(0, 20, 0, 100) mainFrame.BackgroundColor3 = Theme.Main mainFrame.BorderSizePixel = 0 mainFrame.AutomaticSize = Enum.AutomaticSize.Y mainFrame.Active = true mainFrame.Draggable = true mainFrame.Parent = screenGui Instance.new("UICorner", mainFrame).CornerRadius = UDim.new(0, 8) local stroke = Instance.new("UIStroke") stroke.Color = Theme.Accent stroke.Thickness = 1.5 stroke.Transparency = 0.5 stroke.Parent = mainFrame local header = Instance.new("Frame") header.Size = UDim2.new(1, 0, 0, 30) header.BackgroundColor3 = Theme.Header header.BorderSizePixel = 0 header.Parent = mainFrame Instance.new("UICorner", header).CornerRadius = UDim.new(0, 8) local title = Instance.new("TextLabel") title.Size = UDim2.fromScale(1, 1) title.BackgroundTransparency = 1 title.Text = "SERENITY | [RCTRL] TO HIDE" title.TextColor3 = Theme.Accent title.Font = Enum.Font.GothamBold title.TextSize = 10 title.Parent = header local listLayout = Instance.new("UIListLayout") listLayout.Padding = UDim.new(0, 6) listLayout.HorizontalAlignment = Enum.HorizontalAlignment.Center listLayout.SortOrder = Enum.SortOrder.LayoutOrder listLayout.Parent = mainFrame local containers = {} local spacer = Instance.new("Frame") spacer.Size = UDim2.new(1, 0, 0, 25) spacer.BackgroundTransparency = 1 spacer.LayoutOrder = 0 spacer.Parent = mainFrame local minAll = Instance.new("TextButton") minAll.Size = UDim2.new(0.9, 0, 0, 28) minAll.BackgroundColor3 = Color3.fromRGB(40, 20, 30) minAll.Text = "COLLAPSE ALL TABS" minAll.TextColor3 = Color3.fromRGB(255, 100, 100) minAll.Font = Enum.Font.GothamBold minAll.TextSize = 10 minAll.LayoutOrder = 1 minAll.Parent = mainFrame Instance.new("UICorner", minAll) minAll.MouseButton1Click:Connect(function() for i = 1, #containers do local d = containers[i] d.Container.Visible = false d.Button.Text = "[ + ] " .. d.Name end end) local function createModule(name, color) local btn = Instance.new("TextButton") btn.Size = UDim2.new(0.9, 0, 0, 30) btn.BackgroundColor3 = Theme.Button btn.Text = "[ - ] " .. name btn.TextColor3 = color or Theme.Text btn.Font = Enum.Font.GothamBold btn.TextSize = 11 btn.Parent = mainFrame Instance.new("UICorner", btn) local container = Instance.new("Frame") container.Size = UDim2.new(0.9, 0, 0, 0) container.AutomaticSize = Enum.AutomaticSize.Y container.BackgroundTransparency = 1 container.ClipsDescendants = true container.Parent = mainFrame local ll = Instance.new("UIListLayout") ll.Padding = UDim.new(0, 4) ll.Parent = container btn.MouseButton1Click:Connect(function() container.Visible = not container.Visible btn.Text = (container.Visible and "[ - ] " or "[ + ] ") .. name end) containers[#containers + 1] = {Container = container, Button = btn, Name = name} return container end --------------------------- -- STATUS BUTTONS --------------------------- local statusFrame = Instance.new("Frame") statusFrame.Size = UDim2.new(0.9, 0, 0, 40) statusFrame.BackgroundTransparency = 1 statusFrame.LayoutOrder = 2 statusFrame.Parent = mainFrame local aimStatus = Instance.new("TextButton") aimStatus.Size = UDim2.new(0.5, 0, 1, 0) aimStatus.BackgroundTransparency = 1 aimStatus.Text = "AIM: ON" aimStatus.TextColor3 = Theme.On aimStatus.Font = Enum.Font.GothamBold aimStatus.TextSize = 16 aimStatus.Parent = statusFrame local speedStatus = Instance.new("TextButton") speedStatus.Size = UDim2.new(0.5, 0, 1, 0) speedStatus.Position = UDim2.new(0.5, 0, 0, 0) speedStatus.BackgroundTransparency = 1 speedStatus.Text = "SPEED: OFF" speedStatus.TextColor3 = Theme.Off speedStatus.Font = Enum.Font.GothamBold speedStatus.TextSize = 16 speedStatus.Parent = statusFrame local function updateStatus() aimStatus.Text = AimbotEnabled and "AIM: ON" or "AIM: OFF" aimStatus.TextColor3 = AimbotEnabled and Theme.On or Theme.Off speedStatus.Text = speedEnabled and "SPEED: ON" or "SPEED: OFF" speedStatus.TextColor3 = speedEnabled and Theme.On or Theme.Off end aimStatus.MouseButton1Click:Connect(function() AimbotEnabled = not AimbotEnabled if not AimbotEnabled then Attacking = nil UIS.MouseBehavior = previousMouseBehavior end updateStatus() end) speedStatus.MouseButton1Click:Connect(function() speedEnabled = not speedEnabled updateStatus() end) --------------------------- -- TOGGLE BUTTON HELPER --------------------------- local function createToggleBtn(text, startState, parent, callback) local b = Instance.new("TextButton") b.Size = UDim2.new(1, 0, 0, 32) b.BackgroundColor3 = startState and Color3.fromRGB(40, 60, 40) or Color3.fromRGB(60, 40, 40) b.Text = text .. ": " .. (startState and "ON" or "OFF") b.TextColor3 = Theme.Text b.Font = Enum.Font.GothamBold b.TextSize = 13 b.Parent = parent Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() local s = callback() b.Text = text .. ": " .. (s and "ON" or "OFF") b.BackgroundColor3 = s and Color3.fromRGB(40, 60, 40) or Color3.fromRGB(60, 40, 40) end) return b end --------------------------- -- EXTRA MODULES --------------------------- local extraContainer = createModule("EXTRA SCRIPTS", Color3.fromRGB(0, 180, 255)) local lpActive = false createToggleBtn("FullBright", false, extraContainer, function() toggleFullBright() return fbEnabled end) createToggleBtn("AutoLockpick", false, extraContainer, function() lpActive = not lpActive return lpActive end) createToggleBtn("Money ESP", false, extraContainer, function() moneyActive = not moneyActive if moneyActive then for _, obj in ipairs(moneyContainer:GetChildren()) do updateMoneyTag(obj) end else clearMoneyTags() end return moneyActive end) moneyContainer.ChildAdded:Connect(function(child) if moneyActive then task.delay(0.5, function() if moneyActive then updateMoneyTag(child) end end) end end) --------------------------- -- INPUT HELPER --------------------------- local function createInput(name, def, parent, call) local f = Instance.new("Frame") f.Size = UDim2.new(1, 0, 0, 30) f.BackgroundTransparency = 1 f.Parent = parent local l = Instance.new("TextLabel") l.Size = UDim2.new(0.5, 0, 1, 0) l.Text = name l.TextColor3 = Color3.fromRGB(180, 180, 180) l.Font = Enum.Font.Gotham l.TextSize = 11 l.BackgroundTransparency = 1 l.TextXAlignment = Enum.TextXAlignment.Left l.Parent = f local b = Instance.new("TextBox") b.Size = UDim2.new(0.45, 0, 0.8, 0) b.Position = UDim2.new(0.55, 0, 0.1, 0) b.Text = tostring(def) b.BackgroundColor3 = Theme.Button b.TextColor3 = Theme.Text b.Font = Enum.Font.Gotham b.TextSize = 11 b.Parent = f Instance.new("UICorner", b) b.FocusLost:Connect(function() local v = tonumber(b.Text) if v then call(v) elseif b.Text == "" then call("") end end) return b end --------------------------- -- MUSIC PLAYER --------------------------- local Sound = SoundService:FindFirstChild("MasterDJ_Audio") if not Sound then Sound = Instance.new("Sound") Sound.Name = "MasterDJ_Audio" Sound.Parent = SoundService end Sound.Looped = true Sound.Volume = 2 local musicContainer = createModule("MUSIC PLAYER", Color3.fromRGB(0, 255, 150)) local musicBox = createInput("Song ID", "", musicContainer, function() end) local playBtn = Instance.new("TextButton") playBtn.Size = UDim2.new(1, 0, 0, 30) playBtn.BackgroundColor3 = Theme.Accent playBtn.Text = "Play Music" playBtn.TextColor3 = Color3.new(1, 1, 1) playBtn.Font = Enum.Font.GothamBold playBtn.Parent = musicContainer Instance.new("UICorner", playBtn) playBtn.MouseButton1Click:Connect(function() local id = tonumber(musicBox.Text) if id then Sound.SoundId = "rbxassetid://" .. id Sound:Play() end end) createInput("Volume", 2, musicContainer, function(v) if type(v) == "number" then Sound.Volume = v end end) --------------------------- -- CONFIG MODULE --------------------------- local configContainer = createModule("PRESETS & RANGE", Color3.fromRGB(200, 200, 200)) createInput("Range", AimbotRange, configContainer, function(v) AimbotRange = v end) createInput("FOV", MouseFOVRadius, configContainer, function(v) MouseFOVRadius = v end) createInput("Smooth", AimSmoothness, configContainer, function(v) AimSmoothness = v end) createInput("Predict", PredictionFactor, configContainer, function(v) PredictionFactor = v end) createInput("Speed Mult", speedMultiplier, configContainer, function(v) speedMultiplier = v end) --------------------------- -- ESP / TARGETS --------------------------- local espContainer = createModule("ESP & TARGETS", Color3.fromRGB(0, 150, 255)) local function getPlayerColor(p) return blueNames[p.Name] and Color3.new(0, 0.6, 1) or Color3.new(1, 1, 1) end local function applyHighlight(p) local char = p.Character if not char then return end local h = char:FindFirstChild("ESPHighlight") if not toggle then if h then h:Destroy() end return end local color = getPlayerColor(p) if not h then h = Instance.new("Highlight") h.Name = "ESPHighlight" h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop h.FillTransparency = _G.FillTransparency h.OutlineTransparency = _G.OutlineTransparency h.Parent = char end h.FillColor = color h.OutlineColor = color end local function removeTag(p) local t = activeTags[p] if t then t:Destroy() activeTags[p] = nil end end local function createTag(p) local char = p.Character if not char or not toggle then return end local head = char:FindFirstChild("Head") if not head then return end removeTag(p) local tag = Instance.new("BillboardGui") tag.LightInfluence = 0 tag.Name = "NameTag" tag.Size = UDim2.new(0, 100, 0, 25) tag.StudsOffset = Vector3.new(0, 2.5, 0) tag.AlwaysOnTop = true local tl = Instance.new("TextLabel") tl.Size = UDim2.fromScale(1, 1) tl.BackgroundTransparency = 1 tl.Text = p.Name tl.TextColor3 = getPlayerColor(p) tl.Font = Enum.Font.GothamBold tl.TextSize = 7 tl.Parent = tag tag.Parent = head activeTags[p] = tag applyHighlight(p) end local function updatePlayer(p) createTag(p) applyHighlight(p) end local espBtn = Instance.new("TextButton") espBtn.Size = UDim2.new(1, 0, 0, 32) espBtn.BackgroundColor3 = Theme.Button espBtn.Text = "Toggle ESP" espBtn.TextColor3 = Theme.Text espBtn.Font = Enum.Font.GothamBold espBtn.TextSize = 13 espBtn.Parent = espContainer Instance.new("UICorner", espBtn) espBtn.MouseButton1Click:Connect(function() toggle = not toggle espBtn.Text = "ESP: " .. (toggle and "ON" or "OFF") espBtn.BackgroundColor3 = toggle and Color3.fromRGB(40, 80, 40) or Theme.Button for _, p in ipairs(Players:GetPlayers()) do if p ~= player then if toggle then updatePlayer(p) else removeTag(p) applyHighlight(p) end end end end) local blueTogBtn = Instance.new("TextButton") blueTogBtn.Size = UDim2.new(1, 0, 0, 32) blueTogBtn.BackgroundColor3 = Theme.Button blueTogBtn.Text = "Target Blue: OFF" blueTogBtn.TextColor3 = Theme.Text blueTogBtn.Font = Enum.Font.GothamBold blueTogBtn.TextSize = 13 blueTogBtn.Parent = espContainer Instance.new("UICorner", blueTogBtn) blueTogBtn.MouseButton1Click:Connect(function() TargetBlueOnly = not TargetBlueOnly blueTogBtn.Text = "Target Blue: " .. (TargetBlueOnly and "ON" or "OFF") blueTogBtn.BackgroundColor3 = TargetBlueOnly and Color3.fromRGB(40, 80, 40) or Theme.Button end) local listFrame = Instance.new("Frame") listFrame.Size = UDim2.new(1, 0, 0, 150) listFrame.BackgroundColor3 = Color3.fromRGB(10, 10, 15) listFrame.Visible = false listFrame.Parent = espContainer Instance.new("UICorner", listFrame) local sc = Instance.new("ScrollingFrame") sc.Size = UDim2.new(1, -4, 1, -4) sc.Position = UDim2.new(0, 2, 0, 2) sc.BackgroundTransparency = 1 sc.ScrollBarThickness = 2 sc.CanvasSize = UDim2.new(0, 0, 0, 0) sc.AutomaticCanvasSize = Enum.AutomaticSize.Y sc.ScrollingDirection = Enum.ScrollingDirection.Y sc.Parent = listFrame local scLayout = Instance.new("UIListLayout") scLayout.Padding = UDim.new(0, 2) scLayout.Parent = sc scLayout:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function() sc.CanvasSize = UDim2.new(0, 0, 0, scLayout.AbsoluteContentSize.Y) end) -- OPTIMIZE: incremental button cache local playerButtons = {} local function refreshList() local seen = {} local plist = Players:GetPlayers() table.sort(plist, function(a, b) return a.Name:lower() < b.Name:lower() end) for _, p in ipairs(plist) do if p ~= player then local name = p.Name seen[name] = true local b = playerButtons[name] if not b then b = Instance.new("TextButton") b.Name = name b.Size = UDim2.new(1, -10, 0, 30) b.Font = Enum.Font.Gotham b.TextSize = 10 b.TextColor3 = Theme.Text b.Parent = sc Instance.new("UICorner", b) b.MouseButton1Click:Connect(function() blueNames[name] = not blueNames[name] updatePlayer(p) local state = blueNames[name] b.BackgroundColor3 = state and Color3.fromRGB(0, 80, 200) or Color3.fromRGB(35, 40, 55) b.Text = name .. (state and " [BLUE]" or "") end) playerButtons[name] = b end local state = blueNames[name] b.BackgroundColor3 = state and Color3.fromRGB(0, 80, 200) or Color3.fromRGB(35, 40, 55) b.Text = name .. (state and " [BLUE]" or "") end end for name, btn in pairs(playerButtons) do if not seen[name] then btn:Destroy() playerButtons[name] = nil end end end local openBlueBtn = Instance.new("TextButton") openBlueBtn.Size = UDim2.new(1, 0, 0, 32) openBlueBtn.BackgroundColor3 = Theme.Button openBlueBtn.Text = "Open Blue Selector" openBlueBtn.TextColor3 = Theme.Text openBlueBtn.Font = Enum.Font.GothamBold openBlueBtn.TextSize = 13 openBlueBtn.Parent = espContainer Instance.new("UICorner", openBlueBtn) openBlueBtn.MouseButton1Click:Connect(function() listFrame.Visible = not listFrame.Visible if listFrame.Visible then refreshList() end end) --------------------------- -- INPUT (OPTIMIZED: early exits) --------------------------- UIS.InputBegan:Connect(function(input, gpe) if gpe then return end local kc = input.KeyCode if kc == Enum.KeyCode.RightControl then ScriptEnabled = not ScriptEnabled screenGui.Enabled = ScriptEnabled elseif kc == Enum.KeyCode.F2 then AimbotEnabled = not AimbotEnabled if not AimbotEnabled then Attacking = nil UIS.MouseBehavior = previousMouseBehavior end updateStatus() elseif kc == Enum.KeyCode.F3 then speedEnabled = not speedEnabled updateStatus() elseif kc == Enum.KeyCode.W then inputVector = inputVector + VEC_UP elseif kc == Enum.KeyCode.S then inputVector = inputVector + VEC_DOWN elseif input.UserInputType == Enum.UserInputType.MouseButton2 then HoldingRMB = true if AimbotEnabled then previousMouseBehavior = UIS.MouseBehavior UIS.MouseBehavior = Enum.MouseBehavior.LockCenter end end end) UIS.InputEnded:Connect(function(input) if input.UserInputType == Enum.UserInputType.MouseButton2 then HoldingRMB = false Attacking = nil if AimbotEnabled then UIS.MouseBehavior = previousMouseBehavior end elseif input.KeyCode == Enum.KeyCode.W then inputVector = inputVector - VEC_UP elseif input.KeyCode == Enum.KeyCode.S then inputVector = inputVector - VEC_DOWN end end) --------------------------- -- SPEED (OPTIMIZED) --------------------------- RunService:BindToRenderStep("SerenitySpeed", Enum.RenderPriority.Camera.Value, function(dt) if not speedEnabled then return end local char = player.Character if not char then return end local humanoid = char.Humanoid local rootPart = char.HumanoidRootPart if not (humanoid and rootPart) then return end local state = humanoid:GetState() if state == Enum.HumanoidStateType.Climbing or state == Enum.HumanoidStateType.Jumping then if inputVector.Y ~= 0 then local verticalDir = Vector3.new(0, inputVector.Y, 0).Unit rootPart.CFrame = rootPart.CFrame + (verticalDir * humanoid.WalkSpeed * speedMultiplier * dt) end return end local moveDir = humanoid.MoveDirection if moveDir.X ~= 0 or moveDir.Z ~= 0 then rootPart.CFrame = rootPart.CFrame + (moveDir.Unit * humanoid.WalkSpeed * speedMultiplier * dt) end end) --------------------------- -- LOS (OPTIMIZED: reused params table, cached filter) --------------------------- local losParams = RaycastParams.new() losParams.FilterType = Enum.RaycastFilterType.Exclude losParams.IgnoreWater = true local function HasLineOfSight(targetChar) local head = targetChar.Head if not head then return false end local cam = Workspace.CurrentCamera local localChar = player.Character if not cam or not localChar then return false end losParams.FilterDescendantsInstances = {localChar, cam, targetChar} local origin = cam.CFrame.Position local dir = head.Position - origin local ray = Workspace:Raycast(origin, dir, losParams) return ray == nil or ray.Instance:IsDescendantOf(targetChar) end --------------------------- -- AIMBOT (OPTIMIZED) --------------------------- local AIM_USE_LOS = true local AIM_DEBUG = false local AIM_THROTTLE = 3 local frameCounter = 0 -- OPTIMIZE: reusable table to reduce GC pressure local candidateBuffer = {} RunService:BindToRenderStep("SerenityAimbot", Enum.RenderPriority.Camera.Value + 1, function() if not AimbotEnabled or not HoldingRMB then if Attacking then Attacking = nil IsLocked = false end return end Camera = Workspace.CurrentCamera if not Camera then return end if isCharacterDisabled() then Attacking = nil IsLocked = false return end frameCounter = frameCounter + 1 local doSearch = (frameCounter % AIM_THROTTLE) == 0 if not charsFolder or not charsFolder.Parent then charsFolder = Workspace:FindFirstChild("Characters") end local localChar = player.Character local localHrp = localChar and localChar.HumanoidRootPart local mousePos = UIS:GetMouseLocation() -- Validate current lock if Attacking then local c = Attacking.char if not c or not c.Parent then Attacking = nil IsLocked = false else local head = c:FindFirstChild("Head") local hrp = c:FindFirstChild("HumanoidRootPart") local hum = c:FindFirstChildOfClass("Humanoid") local dist = (hrp and localHrp) and (hrp.Position - localHrp.Position).Magnitude or math.huge local dead = hum and hum.Health <= 0 local disabled = Attacking.plr and isCharDisabledByName(Attacking.plr.Name) if not head or dead or disabled or dist > AimbotRange then Attacking = nil IsLocked = false else LastTargetPosition = head.Position LastTargetVelocity = head.Velocity end end end -- Search (throttled) if not Attacking and doSearch then local bestTarget = nil local bufIndex = 0 local function consider(char, plr) if not char or not char.Parent then return end if plr == player then return end local head = char:FindFirstChild("Head") if not head then return end local hum = char:FindFirstChildOfClass("Humanoid") if hum and hum.Health <= 0 then return end if plr then if isCharDisabledByName(plr.Name) then return end if TargetBlueOnly and not blueNames[plr.Name] then return end end local hrp = char:FindFirstChild("HumanoidRootPart") local dist = (hrp and localHrp) and (hrp.Position - localHrp.Position).Magnitude or math.huge if dist > AimbotRange then return end local screenPos, onScreen = Camera:WorldToViewportPoint(head.Position) if not onScreen then return end local dx = screenPos.X - mousePos.X local dy = screenPos.Y - mousePos.Y local d2 = dx * dx + dy * dy local fov2 = MouseFOVRadius * MouseFOVRadius if d2 > fov2 then return end bufIndex = bufIndex + 1 candidateBuffer[bufIndex] = {char = char, plr = plr, d2 = d2} end for _, plr in ipairs(Players:GetPlayers()) do consider(plr.Character, plr) end if charsFolder then for _, obj in ipairs(charsFolder:GetChildren()) do local rig if obj:IsA("Model") then rig = obj elseif obj:IsA("Folder") then rig = obj:FindFirstChildWhichIsA("Model") end if rig then local plr = Players:GetPlayerFromCharacter(rig) or Players:FindFirstChild(obj.Name) consider(rig, plr) end end end -- clear trailing buffer entries for i = bufIndex + 1, #candidateBuffer do candidateBuffer[i] = nil end if bufIndex > 0 then -- sort by 2D squared distance table.sort(candidateBuffer, function(a, b) return a.d2 < b.d2 end) -- OPTIMIZE: only LOS-check top 4 candidates (usually enough) local maxCheck = math.min(bufIndex, 4) for i = 1, maxCheck do local cand = candidateBuffer[i] if (not AIM_USE_LOS) or HasLineOfSight(cand.char) then bestTarget = cand break end end -- cleanup for i = 1, bufIndex do candidateBuffer[i] = nil end end if bestTarget then Attacking = {char = bestTarget.char, plr = bestTarget.plr} IsLocked = true local head = bestTarget.char:FindFirstChild("Head") if head then LastTargetPosition = head.Position LastTargetVelocity = head.Velocity end end end -- Aim if Attacking and IsLocked then local tChar = Attacking.char if not tChar or not tChar.Parent then return end local head = tChar:FindFirstChild("Head") if not head then return end LastTargetPosition = head.Position LastTargetVelocity = head.Velocity local pred = head.Position + (head.Velocity * PredictionFactor) local smoothFactor = 1 / (AimSmoothness * 60) if smoothFactor < 0.01 then smoothFactor = 0.01 elseif smoothFactor > 1 then smoothFactor = 1 end Camera.CFrame = Camera.CFrame:Lerp(CFrame.new(Camera.CFrame.Position, pred), smoothFactor) end end) --------------------------- -- AUTOLOCKPICK (OPTIMIZED & FIXED) --------------------------- task.spawn(function() local cachedLPGui = nil local cachedFramesFolder = nil local cachedSelections = nil local cachedScales = nil while true do if not (ScriptEnabled and lpActive) then if cachedScales then for i = 1, #cachedScales do local s = cachedScales[i] if s and s.Parent and s.Scale ~= 1 then s.Scale = 1 end end end cachedLPGui = nil cachedFramesFolder = nil cachedSelections = nil cachedScales = nil task.wait(1) else local lpgui = cachedLPGui if not lpgui or not lpgui.Parent then lpgui = playerGui:FindFirstChild("LockpickGUI") cachedLPGui = lpgui cachedFramesFolder = nil cachedSelections = nil cachedScales = nil end if lpgui and lpgui.Enabled then if not cachedFramesFolder or not cachedFramesFolder.Parent then local mf = lpgui:FindFirstChild("MF") local lpFrame = mf and mf:FindFirstChild("LP_Frame") cachedFramesFolder = lpFrame and lpFrame:FindFirstChild("Frames") if cachedFramesFolder then cachedSelections = { cachedFramesFolder.B1.Bar.Selection, cachedFramesFolder.B2.Bar.Selection, cachedFramesFolder.B3.Bar.Selection, } cachedScales = {} for i = 1, 3 do local parent = cachedSelections[i].Parent local s = parent:FindFirstChild("UIScale") or Instance.new("UIScale", parent) cachedScales[i] = s end end end if cachedSelections then for i = 1, 3 do local s = cachedScales[i] if s then s.Scale = 10 end local v = cachedSelections[i] local y = v.AbsolutePosition.Y if y >= 450 and y <= 550 then if typeof(mouse1click) == "function" then mouse1click() task.wait(0.1) mouse1release() else warn("SERENITY: executor lacks mouse1click") task.wait(1) end end end end task.wait() else task.wait(0.5) end end end end) --------------------------- -- CHARACTER EVENTS (OPTIMIZED) --------------------------- local function onCharacterAdded(p) p.CharacterAdded:Connect(function() task.delay(0.5, function() if toggle then updatePlayer(p) end end) end) end for _, p in ipairs(Players:GetPlayers()) do if p ~= player then onCharacterAdded(p) end end Players.PlayerAdded:Connect(onCharacterAdded) -- OPTIMIZE: remove stale ESP when players leave Players.PlayerRemoving:Connect(function(p) removeTag(p) blueNames[p.Name] = nil local btn = playerButtons[p.Name] if btn then btn:Destroy() playerButtons[p.Name] = nil end end) updateStatus()