Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local Workspace = game:GetService("Workspace")
- local UserInputService = game:GetService("UserInputService")
- local TweenService = game:GetService("TweenService")
- local player = Players.LocalPlayer
- local camera = Workspace.CurrentCamera
- local ZOMBIE_FOLDER_NAME = "Zombies"
- local MAX_LOCK_DISTANCE = 500
- local AIM_ENABLED = false
- local FOV_CIRCLE_ENABLED = true
- local GUI_VISIBLE = true
- local FOV_RADIUS = 150
- local SMOOTHNESS = 0.15
- local FOV_MIN = 60
- local FOV_MAX = 800
- local SMOOTH_MIN = 0.05
- local SMOOTH_MAX = 0.6
- local AIM_PREDICTIVE = false
- local AIM_PIXEL_ACCURATE = true
- local DOT_ENABLED = true
- local DOT_VISUAL_ENABLED = true
- local DOT_SIZE = 12
- local DOT_COLOR = Color3.fromRGB(0,255,170)
- local DOT_SPAWN_TIME = 0.12
- local DOT_DESPAWN_TIME = 0.08
- local PROXIMITY_FLICK_DISTANCE = 10
- local LEAD_FACTOR = 0.12
- local RETARGET_SCORE_THRESHOLD = 1.35
- local TARGET_SCAN_RATE = 0.06
- local OBSTRUCTION_RATE = 0.05
- local DISTANCE_RATE = 0.1
- local lastTargetScan = 0
- local lastObstruction = 0
- local lastDistance = 0
- local cachedBestTarget = nil
- local cachedBestScore = 0
- local cachedDistance = 0
- local cachedObstructed = false
- local ALERT_DISTANCE = 60
- local CURRENT_TARGET = nil
- local UI_TOGGLE_KEY = Enum.KeyCode.Insert
- local UI_HIDDEN = false
- local WAITING_FOR_KEYBIND = false
- local ASSIST_TOGGLE_KEY = Enum.KeyCode.Q
- local HIGHLIGHTS_TOGGLE_KEY = Enum.KeyCode.E
- local WAITING_FOR_ASSIST_KEYBIND = false
- local WAITING_FOR_HIGHLIGHTS_KEYBIND = false
- local ASSIST_TARGET_MODE = "HEAD"
- local ESP_ENABLED = false
- local ESP_SHOW_LABELS = true
- local ESP_RANGE = 500
- local ESP_RANGE_MIN = 50
- local ESP_RANGE_MAX = 2400
- local ESP_LABEL_RANGE = 220
- local ESP_LABEL_RANGE_MIN = 50
- local ESP_LABEL_RANGE_MAX = 900
- local ESP_LABEL_TEXTSIZE = 16
- local ESP_LABEL_TEXTSIZE_MIN = 12
- local ESP_LABEL_TEXTSIZE_MAX = 22
- local ESP_FILL_COLOR = Color3.fromRGB(0, 0, 0)
- local ESP_FILL_TRANSPARENCY = 1
- local connections = {}
- local renderConnection = nil
- local function connect(signal, fn)
- local c = signal:Connect(fn)
- table.insert(connections, c)
- return c
- end
- local espObjects = {}
- local dotObjects = {}
- local function cleanupESPFor(zombie)
- local obj = espObjects[zombie]
- if not obj then return end
- if obj.billboard then obj.billboard:Destroy() end
- if obj.highlight then obj.highlight:Destroy() end
- espObjects[zombie] = nil
- end
- local function cleanupDotFor(part)
- local obj = dotObjects[part]
- if not obj then return end
- if obj.billboard then obj.billboard:Destroy() end
- dotObjects[part] = nil
- end
- local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
- gui.ResetOnSpawn = false
- gui.IgnoreGuiInset = true
- gui.Name = "XENOMADETHISSHIT"
- local highlightsContainer = Instance.new("Folder")
- highlightsContainer.Name = "_ClientHighlights"
- highlightsContainer.Parent = Workspace
- local openBtn = Instance.new("TextButton", gui)
- openBtn.Size = UDim2.new(0, 100, 0, 40)
- openBtn.Position = UDim2.new(0.02, 0, 0.45, 0)
- openBtn.Text = "MENU"
- openBtn.TextScaled = true
- openBtn.BackgroundColor3 = Color3.fromRGB(40,40,40)
- openBtn.TextColor3 = Color3.new(1,1,1)
- openBtn.Font = Enum.Font.GothamBold
- Instance.new("UICorner", openBtn)
- local hub = Instance.new("Frame", gui)
- hub.Size = UDim2.new(0, 520, 0, 420)
- hub.Position = UDim2.new(0.08, 0, 0.5, -210)
- hub.BackgroundColor3 = Color3.fromRGB(20,20,20)
- hub.BorderSizePixel = 0
- hub.Visible = true
- Instance.new("UICorner", hub)
- hub.BackgroundTransparency = 1
- openBtn.BackgroundTransparency = 1
- TweenService:Create(hub, TweenInfo.new(0.35), { BackgroundTransparency = 0 }):Play()
- TweenService:Create(openBtn, TweenInfo.new(0.35), { BackgroundTransparency = 0 }):Play()
- local titleBar = Instance.new("Frame", hub)
- titleBar.Size = UDim2.new(1, 0, 0, 55)
- titleBar.BackgroundColor3 = Color3.fromRGB(30,30,30)
- titleBar.BorderSizePixel = 0
- Instance.new("UICorner", titleBar)
- local title = Instance.new("TextLabel", titleBar)
- title.Size = UDim2.new(1, 0, 1, 0)
- title.Text = "KILL THEM"
- title.TextScaled = true
- title.TextColor3 = Color3.fromRGB(180, 90, 255)
- title.BackgroundTransparency = 1
- title.Font = Enum.Font.GothamBold
- local dragging = false
- local dragStart, startPos
- connect(titleBar.InputBegan, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = true
- dragStart = input.Position
- startPos = hub.Position
- end
- end)
- connect(UserInputService.InputEnded, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- dragging = false
- end
- end)
- connect(UserInputService.InputChanged, function(input)
- if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
- local delta = input.Position - dragStart
- hub.Position = UDim2.new(
- startPos.X.Scale,
- startPos.X.Offset + delta.X,
- startPos.Y.Scale,
- startPos.Y.Offset + delta.Y
- )
- end
- end)
- local fovCircle = Instance.new("Frame", gui)
- fovCircle.AnchorPoint = Vector2.new(0.5, 0.5)
- fovCircle.BackgroundTransparency = 1
- Instance.new("UICorner", fovCircle).CornerRadius = UDim.new(1,0)
- local fovStroke = Instance.new("UIStroke", fovCircle)
- fovStroke.Thickness = 2
- fovStroke.Color = Color3.new(1,1,1)
- local edgeArrow = Instance.new("ImageLabel")
- edgeArrow.Name = "_EdgeArrow"
- edgeArrow.AnchorPoint = Vector2.new(0.5,0.5)
- edgeArrow.BackgroundTransparency = 1
- edgeArrow.Image = "rbxassetid://6034818372"
- edgeArrow.Size = UDim2.new(0,40,0,40)
- edgeArrow.Visible = false
- edgeArrow.ImageTransparency = 1
- edgeArrow.Parent = gui
- local arrowVisible = false
- local arrowTween
- local function setArrowVisible(state)
- if arrowVisible == state then return end
- arrowVisible = state
- if arrowTween then arrowTween:Cancel() end
- if state then
- edgeArrow.Visible = true
- arrowTween = TweenService:Create(edgeArrow,TweenInfo.new(0.18),{ImageTransparency=0})
- else
- arrowTween = TweenService:Create(edgeArrow,TweenInfo.new(0.15),{ImageTransparency=1})
- arrowTween.Completed:Connect(function()
- edgeArrow.Visible = false
- end)
- end
- arrowTween:Play()
- end
- local bossGlow = Instance.new("Frame")
- bossGlow.Size = UDim2.new(1,0,1,0)
- bossGlow.BackgroundColor3 = Color3.fromRGB(255,70,70)
- bossGlow.BackgroundTransparency = 1
- bossGlow.Parent = gui
- local glowTween
- local glowActive = false
- local function setGlow(state)
- if glowActive == state then return end
- glowActive = state
- if glowTween then glowTween:Cancel() end
- if state then
- bossGlow.BackgroundTransparency = 0.9
- glowTween = TweenService:Create(
- bossGlow,
- TweenInfo.new(0.7,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,-1,true),
- {BackgroundTransparency=0.75}
- )
- glowTween:Play()
- else
- bossGlow.BackgroundTransparency = 1
- end
- end
- local alertFrame = Instance.new("Frame")
- alertFrame.Size = UDim2.new(0,380,0,44)
- alertFrame.Position = UDim2.new(0.5,-190,0,-70)
- alertFrame.BackgroundColor3 = Color3.fromRGB(20,20,20)
- alertFrame.BackgroundTransparency = 0.1
- alertFrame.Visible = false
- alertFrame.Parent = gui
- Instance.new("UICorner",alertFrame)
- local alertStroke = Instance.new("UIStroke",alertFrame)
- alertStroke.Thickness = 2
- local alertText = Instance.new("TextLabel",alertFrame)
- alertText.Size = UDim2.new(1,-12,1,0)
- alertText.Position = UDim2.new(0,6,0,0)
- alertText.BackgroundTransparency = 1
- alertText.TextScaled = true
- alertText.Font = Enum.Font.GothamBold
- alertText.TextColor3 = Color3.new(1,1,1)
- local alertActive = false
- local alertTween
- local function setAlert(state)
- if alertActive == state then return end
- alertActive = state
- if alertTween then alertTween:Cancel() end
- if state then
- alertFrame.Visible = true
- alertTween = TweenService:Create(alertFrame,TweenInfo.new(0.25),{
- Position = UDim2.new(0.5,-190,0,20)
- })
- else
- alertTween = TweenService:Create(alertFrame,TweenInfo.new(0.25),{
- Position = UDim2.new(0.5,-190,0,-70)
- })
- alertTween.Completed:Connect(function()
- alertFrame.Visible = false
- end)
- end
- alertTween:Play()
- end
- local BOSS_NAMES = {
- ["Boss"] = true,
- ["SwampGiant"] = true,
- }
- local SPECIAL_NAMES = {
- ["Destroyer"] = true,
- ["Berserker"] = true,
- ["Hunter"] = true,
- ["GuardianZombie"] = true,
- ["Annihilator"] = true,
- ["ElectricZombie"] = true,
- ["ToxicZombie"] = true,
- ["Flamer"] = true,
- ["Wraith"] = true,
- ["DrenchWraith"] = true,
- ["ArmouredZombie"] = true,
- ["HelmetZombie"] = true,
- ["HeavyArmourZombie"] = true,
- ["Boomer"] = true,
- ["Slasher"] = true,
- ["Crawler"] = true,
- ["HeadlessZombie"] = true,
- ["RiotZombie"] = true,
- ["LongArm"] = true,
- ["LongerArm"] = true,
- ["Lurker"] = true,
- ["SniperZombie"] = true,
- ["MinerZombie"] = true,
- ["Sponger"] = true,
- }
- local DISPLAY_NAME_OVERRIDES = {}
- local function getDisplayName(zombie)
- return DISPLAY_NAME_OVERRIDES[zombie.Name] or zombie.Name
- end
- local COLOR_PRESETS = {
- { name = "CYAN", c = Color3.fromRGB(0, 255, 170) },
- { name = "GREEN", c = Color3.fromRGB(0, 255, 0) },
- { name = "RED", c = Color3.fromRGB(255, 70, 70) },
- { name = "PURPLE", c = Color3.fromRGB(180, 90, 255) },
- { name = "YELLOW", c = Color3.fromRGB(255, 235, 80) },
- { name = "WHITE", c = Color3.fromRGB(255, 255, 255) },
- }
- local MENU_COLOR_INDEX = 4
- local ACCENT_COLOR = COLOR_PRESETS[MENU_COLOR_INDEX].c
- local NORMAL_COLOR_INDEX = 1
- local SPECIAL_COLOR_INDEX = 5
- local BOSS_COLOR_INDEX = 3
- local function getPresetColor(index) return COLOR_PRESETS[index].c end
- local function getPresetName(index) return COLOR_PRESETS[index].name end
- local ESP_FILL_COLOR = Color3.fromRGB(0, 0, 0)
- local ESP_FILL_TRANSPARENCY = 1
- title.TextColor3 = ACCENT_COLOR
- fovStroke.Color = Color3.new(1,1,1)
- connect(openBtn.MouseButton1Click, function()
- GUI_VISIBLE = not GUI_VISIBLE
- hub.Visible = GUI_VISIBLE and (not UI_HIDDEN)
- end)
- local body = Instance.new("Frame", hub)
- body.Size = UDim2.new(1, -20, 1, -75)
- body.Position = UDim2.new(0, 10, 0, 65)
- body.BackgroundTransparency = 1
- local sideBar = Instance.new("Frame", body)
- sideBar.Size = UDim2.new(0, 110, 1, 0)
- sideBar.BackgroundColor3 = Color3.fromRGB(18,18,18)
- sideBar.BorderSizePixel = 0
- Instance.new("UICorner", sideBar)
- local content = Instance.new("Frame", body)
- content.Size = UDim2.new(1, -125, 1, 0)
- content.Position = UDim2.new(0, 125, 0, 0)
- content.BackgroundTransparency = 1
- local function makeSideTab(text, y, big)
- local btn = Instance.new("TextButton", sideBar)
- btn.Size = UDim2.new(1, -14, 0, big and 64 or 44)
- btn.Position = UDim2.new(0, 7, 0, y)
- btn.Text = text
- btn.TextScaled = true
- btn.BackgroundColor3 = Color3.fromRGB(60,60,60)
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Font = Enum.Font.GothamBold
- Instance.new("UICorner", btn)
- return btn
- end
- local aimTabBtn = makeSideTab("AIM", 10, true)
- local espTabBtn = makeSideTab("ESP", 84, true)
- local settingsTabBtn = makeSideTab("SETTINGS", 158, false)
- local function makeScrollingTab(parent, visible)
- local tab = Instance.new("ScrollingFrame", parent)
- tab.Size = UDim2.new(1, 0, 1, 0)
- tab.BackgroundTransparency = 1
- tab.BorderSizePixel = 0
- tab.ScrollBarThickness = 6
- tab.ScrollingDirection = Enum.ScrollingDirection.Y
- tab.AutomaticCanvasSize = Enum.AutomaticSize.Y
- tab.CanvasSize = UDim2.new(0, 0, 0, 0)
- tab.Visible = visible
- local pad = Instance.new("UIPadding", tab)
- pad.PaddingTop = UDim.new(0, 6)
- pad.PaddingBottom = UDim.new(0, 10)
- pad.PaddingLeft = UDim.new(0, 6)
- pad.PaddingRight = UDim.new(0, 6)
- return tab
- end
- local aimTab = makeScrollingTab(content, true)
- local espTab = makeScrollingTab(content, false)
- local settingsTab = makeScrollingTab(content, false)
- local scrollTabs = { aimTab, espTab, settingsTab }
- local function applyScrollTheme()
- for _, sf in ipairs(scrollTabs) do
- if sf and sf.Parent then
- sf.ScrollBarImageColor3 = ACCENT_COLOR
- sf.ScrollBarImageTransparency = 0.15
- end
- end
- end
- local function setActiveTab(tabName)
- local isAim = (tabName == "AIM")
- local isEsp = (tabName == "ESP")
- local isSettings = (tabName == "SETTINGS")
- aimTab.Visible = isAim
- espTab.Visible = isEsp
- settingsTab.Visible = isSettings
- local activeCol = Color3.fromRGB(0,180,120)
- aimTabBtn.BackgroundColor3 = isAim and activeCol or Color3.fromRGB(60,60,60)
- espTabBtn.BackgroundColor3 = isEsp and activeCol or Color3.fromRGB(60,60,60)
- settingsTabBtn.BackgroundColor3 = isSettings and activeCol or Color3.fromRGB(60,60,60)
- end
- setActiveTab("AIM")
- connect(aimTabBtn.MouseButton1Click, function() setActiveTab("AIM") end)
- connect(espTabBtn.MouseButton1Click, function() setActiveTab("ESP") end)
- connect(settingsTabBtn.MouseButton1Click, function() setActiveTab("SETTINGS") end)
- local function addListLayout(parent, padding)
- local list = Instance.new("UIListLayout", parent)
- list.FillDirection = Enum.FillDirection.Vertical
- list.HorizontalAlignment = Enum.HorizontalAlignment.Center
- list.SortOrder = Enum.SortOrder.LayoutOrder
- list.Padding = UDim.new(0, padding or 10)
- return list
- end
- addListLayout(aimTab, 12)
- addListLayout(espTab, 10)
- addListLayout(settingsTab, 12)
- local layoutOrders = {}
- local function nextOrder(parent)
- layoutOrders[parent] = (layoutOrders[parent] or 0) + 1
- return layoutOrders[parent]
- end
- local function makeButton(parent, text)
- local btn = Instance.new("TextButton", parent)
- btn.Size = UDim2.new(1, -10, 0, 44)
- btn.Text = text
- btn.TextScaled = true
- btn.BackgroundColor3 = Color3.fromRGB(60,60,60)
- btn.TextColor3 = Color3.new(1,1,1)
- btn.Font = Enum.Font.GothamBold
- btn.AutoButtonColor = true
- btn.LayoutOrder = nextOrder(parent)
- Instance.new("UICorner", btn)
- return btn
- end
- local function makeSlider(parent, labelText)
- local holder = Instance.new("Frame", parent)
- holder.Size = UDim2.new(1, -10, 0, 70)
- holder.BackgroundTransparency = 1
- holder.LayoutOrder = nextOrder(parent)
- local label = Instance.new("TextLabel", holder)
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Position = UDim2.new(0, 0, 0, 0)
- label.Text = labelText
- label.TextScaled = true
- label.TextColor3 = Color3.new(1,1,1)
- label.BackgroundTransparency = 1
- label.Font = Enum.Font.GothamBold
- local bar = Instance.new("Frame", holder)
- bar.Size = UDim2.new(1, 0, 0, 10)
- bar.Position = UDim2.new(0, 0, 0, 32)
- bar.BackgroundColor3 = Color3.fromRGB(80,80,80)
- Instance.new("UICorner", bar)
- local fill = Instance.new("Frame", bar)
- fill.Size = UDim2.new(0.5, 0, 1, 0)
- fill.BackgroundColor3 = ACCENT_COLOR
- Instance.new("UICorner", fill)
- return bar, fill, holder
- end
- local activeSlider = nil
- local function hookSlider(bar, fill, minVal, maxVal, onChange)
- connect(bar.InputBegan, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- activeSlider = {bar = bar, fill = fill, minVal = minVal, maxVal = maxVal, onChange = onChange}
- end
- end)
- end
- connect(UserInputService.InputEnded, function(input)
- if input.UserInputType == Enum.UserInputType.MouseButton1 then
- activeSlider = nil
- end
- end)
- connect(UserInputService.InputChanged, function(input)
- if activeSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
- local bar = activeSlider.bar
- local fill = activeSlider.fill
- local alpha = math.clamp((input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X, 0, 1)
- fill.Size = UDim2.new(alpha, 0, 1, 0)
- local value = activeSlider.minVal + (activeSlider.maxVal - activeSlider.minVal) * alpha
- activeSlider.onChange(value)
- end
- end)
- local sliderFills = {}
- local function registerFill(fill) table.insert(sliderFills, fill) end
- local function color3ToHSV(c) return Color3.toHSV(c) end
- local function hsvToColor3(h,s,v) return Color3.fromHSV(math.clamp(h,0,1), math.clamp(s,0,1), math.clamp(v,0,1)) end
- local function hexToColor3(hex)
- hex = tostring(hex):gsub("#","")
- if #hex == 3 then
- hex = hex:sub(1,1)..hex:sub(1,1)..hex:sub(2,2)..hex:sub(2,2)..hex:sub(3,3)..hex:sub(3,3)
- end
- if #hex ~= 6 then return nil end
- local r = tonumber(hex:sub(1,2),16)
- local g = tonumber(hex:sub(3,4),16)
- local b = tonumber(hex:sub(5,6),16)
- if not (r and g and b) then return nil end
- return Color3.fromRGB(r,g,b)
- end
- local function color3ToHex(c)
- local r = math.floor(c.R * 255 + 0.5)
- local g = math.floor(c.G * 255 + 0.5)
- local b = math.floor(c.B * 255 + 0.5)
- return string.format("%02X%02X%02X", r,g,b)
- end
- local function createColorPicker(parent, labelText, initialColor, onChange)
- local holder = Instance.new("Frame", parent)
- holder.Size = UDim2.new(1, -10, 0, 120)
- holder.BackgroundTransparency = 1
- holder.LayoutOrder = nextOrder(parent)
- local label = Instance.new("TextLabel", holder)
- label.Size = UDim2.new(1, 0, 0, 20)
- label.Text = labelText
- label.TextScaled = true
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.new(1,1,1)
- label.Font = Enum.Font.GothamBold
- local hBar, hFill = makeSlider(holder, "H")
- local sBar, sFill = makeSlider(holder, "S")
- local vBar, vFill = makeSlider(holder, "V")
- hBar.Parent.Position = UDim2.new(0,0,0,22)
- sBar.Parent.Position = UDim2.new(0,0,0,50)
- vBar.Parent.Position = UDim2.new(0,0,0,78)
- registerFill(hFill); registerFill(sFill); registerFill(vFill)
- local hexBox = Instance.new("TextBox", holder)
- hexBox.Size = UDim2.new(0.4, 0, 0, 24)
- hexBox.Position = UDim2.new(0.58, 0, 0.02, 0)
- hexBox.Text = color3ToHex(initialColor)
- hexBox.Font = Enum.Font.Gotham
- hexBox.TextSize = 14
- hexBox.PlaceholderText = "HEX"
- hexBox.BackgroundColor3 = Color3.fromRGB(50,50,50)
- hexBox.TextColor3 = Color3.new(1,1,1)
- Instance.new("UICorner", hexBox)
- local preview = Instance.new("Frame", holder)
- preview.Size = UDim2.new(0.15, 0, 0, 34)
- preview.Position = UDim2.new(0.82, 0, 0.02, 0)
- preview.BackgroundColor3 = initialColor
- Instance.new("UICorner", preview)
- local h,s,v = color3ToHSV(initialColor)
- local function commit()
- local col = hsvToColor3(h,s,v)
- preview.BackgroundColor3 = col
- hexBox.Text = color3ToHex(col)
- if onChange then pcall(onChange, col) end
- end
- local function setSliders()
- hFill.Size = UDim2.new(h,0,1,0)
- sFill.Size = UDim2.new(s,0,1,0)
- vFill.Size = UDim2.new(v,0,1,0)
- end
- hookSlider(hBar, hFill, 0, 1, function(vv) h = vv setSliders() commit() end)
- hookSlider(sBar, sFill, 0, 1, function(vv) s = vv setSliders() commit() end)
- hookSlider(vBar, vFill, 0, 1, function(vv) v = vv setSliders() commit() end)
- hexBox.FocusLost:Connect(function()
- local c = hexToColor3(hexBox.Text)
- if c then
- h,s,v = color3ToHSV(c)
- setSliders()
- commit()
- else
- hexBox.Text = color3ToHex(preview.BackgroundColor3)
- end
- end)
- setSliders()
- commit()
- return function(col)
- if not col then return end
- h,s,v = color3ToHSV(col)
- setSliders()
- commit()
- end
- end
- local function applyAccent()
- title.TextColor3 = ACCENT_COLOR
- for _, fill in ipairs(sliderFills) do
- if fill and fill.Parent then
- fill.BackgroundColor3 = ACCENT_COLOR
- end
- end
- applyScrollTheme()
- end
- applyAccent()
- local aimBtn = makeButton(aimTab, "AIM: OFF")
- connect(aimBtn.MouseButton1Click, function()
- AIM_ENABLED = not AIM_ENABLED
- if not AIM_ENABLED then
- CURRENT_TARGET = nil
- end
- aimBtn.Text = AIM_ENABLED and "AIM: ON" or "AIM: OFF"
- aimBtn.BackgroundColor3 = AIM_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
- end)
- local fovBtn = makeButton(aimTab, "FOV CIRCLE: ON")
- connect(fovBtn.MouseButton1Click, function()
- FOV_CIRCLE_ENABLED = not FOV_CIRCLE_ENABLED
- fovBtn.Text = FOV_CIRCLE_ENABLED and "FOV CIRCLE: ON" or "FOV CIRCLE: OFF"
- end)
- local fovBar, fovFill = makeSlider(aimTab, "FOV SIZE")
- registerFill(fovFill)
- hookSlider(fovBar, fovFill, FOV_MIN, FOV_MAX, function(v) FOV_RADIUS = v end)
- local smoothBar, smoothFill = makeSlider(aimTab, "SMOOTHNESS")
- registerFill(smoothFill)
- hookSlider(smoothBar, smoothFill, SMOOTH_MIN, SMOOTH_MAX, function(v) SMOOTHNESS = v end)
- local dotToggleBtn = makeButton(aimTab, "TRACK DOT: ON")
- connect(dotToggleBtn.MouseButton1Click, function()
- DOT_ENABLED = not DOT_ENABLED
- dotToggleBtn.Text = DOT_ENABLED and "TRACK DOT: ON" or "TRACK DOT: OFF"
- end)
- local dotVisualBtn = makeButton(aimTab, "DOT VISIBLE: ON")
- connect(dotVisualBtn.MouseButton1Click, function()
- DOT_VISUAL_ENABLED = not DOT_VISUAL_ENABLED
- dotVisualBtn.Text = DOT_VISUAL_ENABLED and "DOT VISIBLE: ON" or "DOT VISIBLE: OFF"
- end)
- local dotSizeBar, dotSizeFill = makeSlider(aimTab, "DOT SIZE")
- registerFill(dotSizeFill)
- hookSlider(dotSizeBar, dotSizeFill, 4, 64, function(v) DOT_SIZE = math.floor(v) end)
- local setDotColorExternally = createColorPicker(aimTab, "DOT COLOR", DOT_COLOR, function(col)
- DOT_COLOR = col
- for part, d in pairs(dotObjects) do
- if d and d.frame then
- d.frame.BackgroundColor3 = DOT_COLOR
- end
- end
- end)
- setDotColorExternally(DOT_COLOR)
- local espBtn = makeButton(espTab, "ESP: OFF")
- connect(espBtn.MouseButton1Click, function()
- ESP_ENABLED = not ESP_ENABLED
- espBtn.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
- espBtn.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
- end)
- local labelBtn = makeButton(espTab, "LABELS: ON")
- connect(labelBtn.MouseButton1Click, function()
- ESP_SHOW_LABELS = not ESP_SHOW_LABELS
- labelBtn.Text = ESP_SHOW_LABELS and "LABELS: ON" or "LABELS: OFF"
- end)
- local normalColorBtn = makeButton(espTab, "NORMAL COLOR: " .. getPresetName(NORMAL_COLOR_INDEX))
- connect(normalColorBtn.MouseButton1Click, function()
- NORMAL_COLOR_INDEX += 1
- if NORMAL_COLOR_INDEX > #COLOR_PRESETS then NORMAL_COLOR_INDEX = 1 end
- normalColorBtn.Text = "NORMAL COLOR: " .. getPresetName(NORMAL_COLOR_INDEX)
- end)
- local specialColorBtn = makeButton(espTab, "SPECIAL COLOR: " .. getPresetName(SPECIAL_COLOR_INDEX))
- connect(specialColorBtn.MouseButton1Click, function()
- SPECIAL_COLOR_INDEX += 1
- if SPECIAL_COLOR_INDEX > #COLOR_PRESETS then SPECIAL_COLOR_INDEX = 1 end
- specialColorBtn.Text = "SPECIAL COLOR: " .. getPresetName(SPECIAL_COLOR_INDEX)
- end)
- local bossColorBtn = makeButton(espTab, "BOSS COLOR: " .. getPresetName(BOSS_COLOR_INDEX))
- connect(bossColorBtn.MouseButton1Click, function()
- BOSS_COLOR_INDEX += 1
- if BOSS_COLOR_INDEX > #COLOR_PRESETS then BOSS_COLOR_INDEX = 1 end
- bossColorBtn.Text = "BOSS COLOR: " .. getPresetName(BOSS_COLOR_INDEX)
- end)
- local espRangeBar, espRangeFill = makeSlider(espTab, "ESP RANGE")
- registerFill(espRangeFill)
- hookSlider(espRangeBar, espRangeFill, ESP_RANGE_MIN, ESP_RANGE_MAX, function(v) ESP_RANGE = v end)
- local labelRangeBar, labelRangeFill = makeSlider(espTab, "LABEL RANGE")
- registerFill(labelRangeFill)
- hookSlider(labelRangeBar, labelRangeFill, ESP_LABEL_RANGE_MIN, ESP_LABEL_RANGE_MAX, function(v) ESP_LABEL_RANGE = v end)
- local labelSizeBar, labelSizeFill = makeSlider(espTab, "LABEL SIZE")
- registerFill(labelSizeFill)
- hookSlider(labelSizeBar, labelSizeFill, ESP_LABEL_TEXTSIZE_MIN, ESP_LABEL_TEXTSIZE_MAX, function(v)
- ESP_LABEL_TEXTSIZE = math.floor(v)
- end)
- local menuColorBtn = makeButton(settingsTab, "MENU COLOR: " .. getPresetName(MENU_COLOR_INDEX))
- connect(menuColorBtn.MouseButton1Click, function()
- MENU_COLOR_INDEX += 1
- if MENU_COLOR_INDEX > #COLOR_PRESETS then MENU_COLOR_INDEX = 1 end
- menuColorBtn.Text = "MENU COLOR: " .. getPresetName(MENU_COLOR_INDEX)
- ACCENT_COLOR = getPresetColor(MENU_COLOR_INDEX)
- applyAccent()
- end)
- local setAccentExternally = createColorPicker(settingsTab, "MENU ACCENT COLOR", ACCENT_COLOR, function(col)
- ACCENT_COLOR = col
- applyAccent()
- end)
- local keybindBtn = makeButton(settingsTab, "UI KEY: " .. tostring(UI_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
- connect(keybindBtn.MouseButton1Click, function()
- WAITING_FOR_KEYBIND = true
- keybindBtn.Text = "PRESS A KEY..."
- keybindBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
- end)
- local assistKeyBtn = makeButton(settingsTab, "ASSIST KEY: " .. tostring(ASSIST_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
- connect(assistKeyBtn.MouseButton1Click, function()
- WAITING_FOR_ASSIST_KEYBIND = true
- assistKeyBtn.Text = "PRESS A KEY..."
- assistKeyBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
- end)
- local highlightsKeyBtn = makeButton(settingsTab, "HIGHLIGHTS KEY: " .. tostring(HIGHLIGHTS_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
- connect(highlightsKeyBtn.MouseButton1Click, function()
- WAITING_FOR_HIGHLIGHTS_KEYBIND = true
- highlightsKeyBtn.Text = "PRESS A KEY..."
- highlightsKeyBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
- end)
- local assistTargetBtn = makeButton(settingsTab, "ASSIST TARGET: " .. ASSIST_TARGET_MODE)
- connect(assistTargetBtn.MouseButton1Click, function()
- ASSIST_TARGET_MODE = (ASSIST_TARGET_MODE == "HEAD") and "TORSO" or "HEAD"
- assistTargetBtn.Text = "ASSIST TARGET: " .. ASSIST_TARGET_MODE
- if CURRENT_TARGET and CURRENT_TARGET.Parent then
- local zombie = CURRENT_TARGET.Parent
- local newPart = getAssistPart(zombie)
- if newPart and newPart ~= CURRENT_TARGET then
- if dotObjects and dotObjects[CURRENT_TARGET] then
- despawnDotForPart(CURRENT_TARGET)
- end
- CURRENT_TARGET = newPart
- end
- end
- end)
- local setHighlightColorExternally = createColorPicker(settingsTab, "HIGHLIGHT OUTLINE COLOR", getPresetColor(NORMAL_COLOR_INDEX), function(col)
- for _, obj in pairs(espObjects) do
- if obj.highlight then
- obj.highlight.OutlineColor = col
- end
- end
- end)
- local setDotColorFromSettings = createColorPicker(settingsTab, "DOT COLOR (ALT)", DOT_COLOR, function(col)
- DOT_COLOR = col
- for part, d in pairs(dotObjects) do
- if d and d.frame then
- d.frame.BackgroundColor3 = DOT_COLOR
- end
- end
- end)
- local unloadBtn = makeButton(settingsTab, "UNLOAD")
- setAccentExternally(ACCENT_COLOR)
- applyAccent()
- local function getAimPart(zombie)
- return zombie:FindFirstChild("HumanoidRootPart")
- or zombie:FindFirstChild("Torso")
- or zombie:FindFirstChild("Head")
- end
- local function getAssistPart(zombie)
- if ASSIST_TARGET_MODE == "HEAD" then
- return zombie:FindFirstChild("Head")
- or zombie:FindFirstChild("HumanoidRootPart")
- or zombie:FindFirstChild("Torso")
- else
- return zombie:FindFirstChild("Torso")
- or zombie:FindFirstChild("HumanoidRootPart")
- or zombie:FindFirstChild("Head")
- end
- end
- local function computeThreatScore(part)
- if not part or not part.Parent then return 0 end
- local camPos = camera.CFrame.Position
- local worldDist = (camPos - part.Position).Magnitude
- if worldDist > MAX_LOCK_DISTANCE then return 0 end
- local screenPos, onScreen = camera:WorldToViewportPoint(part.Position)
- if not onScreen then return 0 end
- local center = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y/2)
- local screenDist = (Vector2.new(screenPos.X, screenPos.Y) - center).Magnitude
- local v = Vector3.new()
- local root = part.Parent:FindFirstChild("HumanoidRootPart")
- if root then
- v = root.AssemblyLinearVelocity or root.Velocity
- end
- local toPlayer = Vector3.new()
- if player.Character and player.Character.PrimaryPart then
- toPlayer = (player.Character.PrimaryPart.Position - part.Position)
- end
- local approach = 0
- if v.Magnitude > 1 and toPlayer.Magnitude > 0 then
- approach = math.max(0, v.Unit:Dot(toPlayer.Unit))
- end
- local score = (1 / (worldDist + 1)) * (1 / (screenDist + 1)) * (1 + approach * 2)
- if worldDist <= PROXIMITY_FLICK_DISTANCE then
- score = score * 3.5
- end
- return score
- end
- local function getBestZombieTarget()
- local folder = Workspace:FindFirstChild(ZOMBIE_FOLDER_NAME)
- if not folder then return nil, 0 end
- local bestPart = nil
- local bestScore = 0
- for _, zombie in ipairs(folder:GetChildren()) do
- local part = getAssistPart(zombie)
- local hum = zombie:FindFirstChildOfClass("Humanoid")
- if part and hum and hum.Health > 0 then
- local score = computeThreatScore(part)
- if score > bestScore and score > 0 then
- bestScore = score
- bestPart = part
- end
- end
- end
- return bestPart, bestScore
- end
- local function getZombieType(zombie)
- if BOSS_NAMES[zombie.Name] then return "BOSS" end
- if SPECIAL_NAMES[zombie.Name] then return "SPECIAL" end
- local t = zombie:GetAttribute("Type")
- if t == "Boss" or t == "BOSS" then return "BOSS" end
- if t == "Special" or t == "SPECIAL" then return "SPECIAL" end
- local isBoss = zombie:FindFirstChild("IsBoss")
- if isBoss and isBoss:IsA("BoolValue") and isBoss.Value == true then
- return "BOSS"
- end
- local isSpecial = zombie:FindFirstChild("IsSpecial")
- if isSpecial and isSpecial:IsA("BoolValue") and isSpecial.Value == true then
- return "SPECIAL"
- end
- return "NORMAL"
- end
- local function getTypeColor(zType)
- if zType == "BOSS" then
- return getPresetColor(BOSS_COLOR_INDEX)
- end
- if zType == "SPECIAL" then
- return getPresetColor(SPECIAL_COLOR_INDEX)
- end
- return getPresetColor(NORMAL_COLOR_INDEX)
- end
- local function ensureESPFor(zombie)
- if espObjects[zombie] then
- return espObjects[zombie]
- end
- local adorneePart = getAimPart(zombie)
- if not adorneePart then return nil end
- local h = Instance.new("Highlight")
- h.Name = "_ClientHighlight"
- h.Adornee = zombie
- h.Parent = highlightsContainer
- h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- h.FillColor = ESP_FILL_COLOR
- h.FillTransparency = ESP_FILL_TRANSPARENCY
- h.OutlineTransparency = 0
- local bb = Instance.new("BillboardGui")
- bb.Name = "_ClientBillboard"
- bb.Adornee = adorneePart
- bb.AlwaysOnTop = true
- bb.Size = UDim2.new(0, 240, 0, 46)
- bb.StudsOffset = Vector3.new(0, 2.8, 0)
- bb.Parent = gui
- local label = Instance.new("TextLabel", bb)
- label.Size = UDim2.new(1, 0, 1, 0)
- label.BackgroundTransparency = 1
- label.TextStrokeTransparency = 0.35
- label.TextScaled = false
- label.TextSize = ESP_LABEL_TEXTSIZE
- label.Font = Enum.Font.GothamBold
- label.Text = getDisplayName(zombie)
- espObjects[zombie] = {highlight = h, billboard = bb, label = label}
- return espObjects[zombie]
- end
- local function createDotForPart(part)
- if not part or not part.Parent then return nil end
- if dotObjects[part] then return dotObjects[part] end
- local bb = Instance.new("BillboardGui")
- bb.Name = "_ClientTrackDot"
- bb.Adornee = part
- bb.AlwaysOnTop = true
- bb.Size = UDim2.new(0, 0, 0, 0)
- bb.StudsOffset = Vector3.new(0, 0.3, 0)
- bb.Parent = gui
- local dotFrame = Instance.new("Frame", bb)
- dotFrame.Size = UDim2.new(1, 0, 1, 0)
- dotFrame.BackgroundColor3 = DOT_COLOR
- dotFrame.BorderSizePixel = 0
- dotFrame.BackgroundTransparency = 1
- local corner = Instance.new("UICorner", dotFrame)
- corner.CornerRadius = UDim.new(1, 0)
- dotObjects[part] = {billboard = bb, frame = dotFrame}
- pcall(function()
- local t1 = TweenService:Create(bb, TweenInfo.new(DOT_SPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
- Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
- })
- local t2 = TweenService:Create(dotFrame, TweenInfo.new(DOT_SPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
- BackgroundTransparency = 0
- })
- t1:Play(); t2:Play()
- end)
- return dotObjects[part]
- end
- local function despawnDotForPart(part)
- local obj = dotObjects[part]
- if not obj then return end
- pcall(function()
- if obj.billboard then
- TweenService:Create(obj.billboard, TweenInfo.new(DOT_DESPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
- Size = UDim2.new(0,0,0,0)
- }):Play()
- end
- if obj.frame then
- TweenService:Create(obj.frame, TweenInfo.new(DOT_DESPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
- BackgroundTransparency = 1
- }):Play()
- end
- end)
- task.delay(DOT_DESPAWN_TIME + 0.02, function()
- pcall(function()
- cleanupDotFor(part)
- end)
- end)
- end
- local function updateDotForPart(part)
- local obj = dotObjects[part]
- if not obj then return end
- if obj.billboard then
- obj.billboard.Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
- obj.billboard.Enabled = (AIM_ENABLED and DOT_ENABLED and DOT_VISUAL_ENABLED)
- end
- if obj.frame then
- obj.frame.BackgroundColor3 = DOT_COLOR
- obj.frame.BackgroundTransparency = DOT_VISUAL_ENABLED and 0 or 1
- end
- end
- local function ensureDotForPart(part)
- if dotObjects[part] then return dotObjects[part] end
- return createDotForPart(part)
- end
- connect(UserInputService.InputBegan, function(input, gameProcessed)
- if gameProcessed then return end
- if WAITING_FOR_KEYBIND then
- if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
- UI_TOGGLE_KEY = input.KeyCode
- WAITING_FOR_KEYBIND = false
- keybindBtn.Text = "UI KEY: " .. tostring(UI_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
- keybindBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
- end
- return
- end
- if WAITING_FOR_ASSIST_KEYBIND then
- if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
- ASSIST_TOGGLE_KEY = input.KeyCode
- WAITING_FOR_ASSIST_KEYBIND = false
- assistKeyBtn.Text = "ASSIST KEY: " .. tostring(ASSIST_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
- assistKeyBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
- end
- return
- end
- if WAITING_FOR_HIGHLIGHTS_KEYBIND then
- if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
- HIGHLIGHTS_TOGGLE_KEY = input.KeyCode
- WAITING_FOR_HIGHLIGHTS_KEYBIND = false
- highlightsKeyBtn.Text = "HIGHLIGHTS KEY: " .. tostring(HIGHLIGHTS_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
- highlightsKeyBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
- end
- return
- end
- if input.KeyCode == ASSIST_TOGGLE_KEY then
- AIM_ENABLED = not AIM_ENABLED
- if not AIM_ENABLED then
- for part, d in pairs(dotObjects) do
- if d and d.billboard then
- pcall(function()
- TweenService:Create(d.billboard, TweenInfo.new(DOT_DESPAWN_TIME), {Size = UDim2.new(0,0,0,0)}):Play()
- TweenService:Create(d.frame, TweenInfo.new(DOT_DESPAWN_TIME), {BackgroundTransparency = 1}):Play()
- end)
- end
- end
- CURRENT_TARGET = nil
- end
- aimBtn.Text = AIM_ENABLED and "AIM: ON" or "AIM: OFF"
- aimBtn.BackgroundColor3 = AIM_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
- return
- end
- if input.KeyCode == HIGHLIGHTS_TOGGLE_KEY then
- ESP_ENABLED = not ESP_ENABLED
- espBtn.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
- espBtn.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
- return
- end
- if input.KeyCode == UI_TOGGLE_KEY then
- UI_HIDDEN = not UI_HIDDEN
- openBtn.Visible = not UI_HIDDEN
- hub.Visible = (not UI_HIDDEN) and GUI_VISIBLE
- return
- end
- end)
- local function fadeOutAndDestroy()
- AIM_ENABLED = false
- FOV_CIRCLE_ENABLED = false
- ESP_ENABLED = false
- CURRENT_TARGET = nil
- setArrowVisible(false)
- setGlow(false)
- setAlert(false)
- if renderConnection then
- renderConnection:Disconnect()
- renderConnection = nil
- end
- for zombie, _ in pairs(espObjects) do
- pcall(function() cleanupESPFor(zombie) end)
- end
- for part, _ in pairs(dotObjects) do
- pcall(function() cleanupDotFor(part) end)
- end
- for _, c in ipairs(connections) do
- pcall(function() c:Disconnect() end)
- end
- pcall(function() highlightsContainer:Destroy() end)
- local t1 = TweenService:Create(hub, TweenInfo.new(0.35), { BackgroundTransparency = 1 })
- local t2 = TweenService:Create(openBtn, TweenInfo.new(0.35), { BackgroundTransparency = 1, TextTransparency = 1 })
- t1:Play(); t2:Play()
- pcall(function() t1.Completed:Wait() end)
- pcall(function() gui:Destroy() end)
- end
- connect(unloadBtn.MouseButton1Click, fadeOutAndDestroy)
- local obstructionParams = RaycastParams.new()
- obstructionParams.FilterType = Enum.RaycastFilterType.Blacklist
- obstructionParams.IgnoreWater = true
- local function refreshObstructionFilter()
- local char = player.Character
- if char then
- obstructionParams.FilterDescendantsInstances = { char }
- else
- obstructionParams.FilterDescendantsInstances = {}
- end
- end
- refreshObstructionFilter()
- connect(player.CharacterAdded, function()
- task.defer(refreshObstructionFilter)
- end)
- renderConnection = RunService.RenderStepped:Connect(function(dt)
- fovCircle.Visible = FOV_CIRCLE_ENABLED
- fovCircle.Position = UDim2.new(0.5, 0, 0.5, 0)
- fovCircle.Size = UDim2.new(0, FOV_RADIUS * 2, 0, FOV_RADIUS * 2)
- if Workspace.CurrentCamera ~= camera then
- camera = Workspace.CurrentCamera
- end
- local now = tick()
- if AIM_ENABLED then
- if now - lastTargetScan > TARGET_SCAN_RATE then
- lastTargetScan = now
- cachedBestTarget, cachedBestScore = getBestZombieTarget()
- end
- local found = cachedBestTarget
- local bestScore = cachedBestScore
- if not CURRENT_TARGET and found then
- CURRENT_TARGET = found
- elseif found and CURRENT_TARGET then
- local currentScore = computeThreatScore(CURRENT_TARGET)
- if found ~= CURRENT_TARGET then
- if bestScore > (currentScore * RETARGET_SCORE_THRESHOLD) then
- if dotObjects[CURRENT_TARGET] then
- despawnDotForPart(CURRENT_TARGET)
- end
- CURRENT_TARGET = found
- else
- local worldDist = (camera.CFrame.Position - found.Position).Magnitude
- if worldDist <= PROXIMITY_FLICK_DISTANCE then
- if dotObjects[CURRENT_TARGET] then
- despawnDotForPart(CURRENT_TARGET)
- end
- CURRENT_TARGET = found
- end
- end
- end
- elseif found and not CURRENT_TARGET then
- CURRENT_TARGET = found
- end
- if CURRENT_TARGET then
- local hum = CURRENT_TARGET.Parent and CURRENT_TARGET.Parent:FindFirstChildOfClass("Humanoid")
- if (not hum) or hum.Health <= 0 or hum:GetState() == Enum.HumanoidStateType.Dead then
- if dotObjects[CURRENT_TARGET] then
- despawnDotForPart(CURRENT_TARGET)
- end
- CURRENT_TARGET = nil
- end
- end
- if CURRENT_TARGET then
- local camPos = camera.CFrame.Position
- if now - lastDistance > DISTANCE_RATE then
- lastDistance = now
- cachedDistance = (camPos - CURRENT_TARGET.Position).Magnitude
- end
- if now - lastObstruction > OBSTRUCTION_RATE then
- lastObstruction = now
- local result = Workspace:Raycast(camPos, CURRENT_TARGET.Position - camPos, obstructionParams)
- cachedObstructed = (result ~= nil) and (not result.Instance:IsDescendantOf(CURRENT_TARGET.Parent))
- end
- else
- cachedObstructed = false
- cachedDistance = 0
- end
- else
- CURRENT_TARGET = nil
- cachedObstructed = false
- cachedDistance = 0
- end
- if AIM_ENABLED and CURRENT_TARGET then
- fovStroke.Color = ACCENT_COLOR
- local target = CURRENT_TARGET
- local camPos = camera.CFrame.Position
- local prediction = Vector3.new()
- if AIM_PREDICTIVE then
- local root = target.Parent and target.Parent:FindFirstChild("HumanoidRootPart")
- if root then
- local vel = root.AssemblyLinearVelocity or root.Velocity
- prediction = vel * LEAD_FACTOR
- end
- end
- local worldDist = cachedDistance > 0 and cachedDistance or (camPos - target.Position).Magnitude
- local proximityFactor = math.clamp(1 - (worldDist / (PROXIMITY_FLICK_DISTANCE * 4)), 0, 1)
- local smoothNorm = math.clamp((SMOOTHNESS - SMOOTH_MIN) / (SMOOTH_MAX - SMOOTH_MIN), 0, 1)
- local baseLerp = 0.04 + (1 - smoothNorm) * 0.9
- local lerpT = math.clamp(baseLerp * (1 - proximityFactor * 0.85), 0.02, 0.95)
- if worldDist <= PROXIMITY_FLICK_DISTANCE then
- lerpT = math.max(lerpT * 0.12, 0.02)
- end
- local targetPos = target.Position + prediction
- if AIM_PIXEL_ACCURATE then
- local screenPos, onScreen = camera:WorldToViewportPoint(targetPos)
- if onScreen then
- local ray = camera:ViewportPointToRay(screenPos.X, screenPos.Y)
- local camToPart = targetPos - camPos
- local depth = camToPart:Dot(camera.CFrame.LookVector)
- if depth < 0.1 then depth = 0.1 end
- targetPos = ray.Origin + ray.Direction * depth
- end
- end
- camera.CFrame = camera.CFrame:Lerp(CFrame.new(camPos, targetPos), math.clamp(1 - lerpT, 0.02, 0.995))
- else
- fovStroke.Color = Color3.new(1,1,1)
- end
- local folder = Workspace:FindFirstChild(ZOMBIE_FOLDER_NAME)
- if not folder then
- for zombie, _ in pairs(espObjects) do
- cleanupESPFor(zombie)
- end
- else
- if not ESP_ENABLED then
- for _, obj in pairs(espObjects) do
- if obj.highlight then obj.highlight.Enabled = false end
- if obj.billboard then obj.billboard.Enabled = false end
- end
- else
- for _, zombie in ipairs(folder:GetChildren()) do
- local hum = zombie:FindFirstChildOfClass("Humanoid")
- local part = getAimPart(zombie)
- if part and hum and hum.Health > 0 then
- local dist = (camera.CFrame.Position - part.Position).Magnitude
- local zType = getZombieType(zombie)
- local col = getTypeColor(zType)
- if dist <= ESP_RANGE then
- local obj = ensureESPFor(zombie)
- if obj then
- local newPart = getAimPart(zombie)
- if newPart and obj.billboard.Adornee ~= newPart then
- obj.billboard.Adornee = newPart
- end
- obj.highlight.Enabled = true
- obj.highlight.OutlineColor = col
- obj.highlight.FillColor = ESP_FILL_COLOR
- obj.highlight.FillTransparency = ESP_FILL_TRANSPARENCY
- local showLabel = ESP_SHOW_LABELS and (dist <= ESP_LABEL_RANGE)
- obj.billboard.Enabled = showLabel
- if showLabel then
- obj.label.TextSize = ESP_LABEL_TEXTSIZE
- obj.label.TextColor3 = col
- local extraY = math.clamp(dist / 220, 0, 2.2)
- obj.billboard.StudsOffset = Vector3.new(0, 2.8 + extraY, 0)
- local tag = ""
- if zType == "BOSS" then
- tag = "BOSS "
- elseif zType == "SPECIAL" then
- tag = "SPECIAL "
- end
- obj.label.Text = tag .. getDisplayName(zombie) .. " [" .. tostring(math.floor(dist)) .. "m]"
- end
- end
- else
- local obj = espObjects[zombie]
- if obj then
- if obj.highlight then obj.highlight.Enabled = false end
- if obj.billboard then obj.billboard.Enabled = false end
- end
- end
- else
- local obj = espObjects[zombie]
- if obj then
- if obj.highlight then obj.highlight.Enabled = false end
- if obj.billboard then obj.billboard.Enabled = false end
- end
- end
- end
- end
- end
- if AIM_ENABLED and DOT_ENABLED then
- local t = CURRENT_TARGET
- if t then
- local adornee = t
- local dotObj = ensureDotForPart(adornee)
- if dotObj then
- for part, d in pairs(dotObjects) do
- if part ~= adornee and d and d.billboard and d.billboard.Enabled then
- despawnDotForPart(part)
- end
- end
- updateDotForPart(adornee)
- end
- else
- for part, d in pairs(dotObjects) do
- if d and d.billboard and d.billboard.Enabled then
- despawnDotForPart(part)
- end
- end
- end
- else
- for part, d in pairs(dotObjects) do
- if d and d.billboard and d.billboard.Enabled then
- despawnDotForPart(part)
- end
- end
- end
- if AIM_ENABLED and CURRENT_TARGET then
- local screenPos, onScreen = camera:WorldToViewportPoint(CURRENT_TARGET.Position)
- local shouldShowArrow = (not onScreen) or cachedObstructed
- if shouldShowArrow then
- local center = Vector2.new(camera.ViewportSize.X/2,camera.ViewportSize.Y/2)
- local dir = Vector2.new(screenPos.X,screenPos.Y) - center
- if dir.Magnitude < 1 then dir = Vector2.new(1,0) end
- local edgeDist = math.min(camera.ViewportSize.X, camera.ViewportSize.Y)/2 - 60
- local edgePos = center + dir.Unit * edgeDist
- edgeArrow.Position = UDim2.new(0, edgePos.X, 0, edgePos.Y)
- edgeArrow.Rotation = math.deg(math.atan2(dir.Y, dir.X)) + 90
- local scale = math.clamp(1.6 - (cachedDistance/200), 0.8, 1.6)
- edgeArrow.Size = UDim2.new(0, 40*scale, 0, 40*scale)
- edgeArrow.ImageColor3 = cachedObstructed and Color3.fromRGB(255,120,120) or Color3.new(1,1,1)
- setArrowVisible(true)
- else
- setArrowVisible(false)
- end
- local zombie = CURRENT_TARGET.Parent
- if zombie and getZombieType(zombie) == "BOSS" then
- local look = camera.CFrame.LookVector
- local dirToTarget = (CURRENT_TARGET.Position - camera.CFrame.Position).Unit
- if look:Dot(dirToTarget) < 0 then
- setGlow(true)
- else
- setGlow(false)
- end
- else
- setGlow(false)
- end
- if cachedDistance > 0 and cachedDistance <= ALERT_DISTANCE then
- alertStroke.Color = Color3.fromRGB(255,70,70)
- alertText.Text = "CLOSE - " .. math.floor(cachedDistance) .. "m"
- setAlert(true)
- else
- setAlert(false)
- end
- else
- setArrowVisible(false)
- setGlow(false)
- setAlert(false)
- end
- for zombie, _ in pairs(espObjects) do
- if not zombie:IsDescendantOf(Workspace) then
- cleanupESPFor(zombie)
- end
- end
- for part, _ in pairs(dotObjects) do
- if not part:IsDescendantOf(Workspace) then
- cleanupDotFor(part)
- end
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment