vetelavergacucaracha

fls

Feb 25th, 2026
20
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 44.37 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local Workspace = game:GetService("Workspace")
  4. local UserInputService = game:GetService("UserInputService")
  5. local TweenService = game:GetService("TweenService")
  6.  
  7.  
  8. local player = Players.LocalPlayer
  9. local camera = Workspace.CurrentCamera
  10.  
  11.  
  12. local ZOMBIE_FOLDER_NAME = "Zombies"
  13. local MAX_LOCK_DISTANCE = 500
  14.  
  15. local AIM_ENABLED = false
  16. local FOV_CIRCLE_ENABLED = true
  17. local GUI_VISIBLE = true
  18.  
  19. local FOV_RADIUS = 150
  20. local SMOOTHNESS = 0.15
  21.  
  22.  
  23. local FOV_MIN = 60
  24. local FOV_MAX = 800
  25. local SMOOTH_MIN = 0.05
  26. local SMOOTH_MAX = 0.6
  27.  
  28.  
  29. local AIM_PREDICTIVE = false
  30. local AIM_PIXEL_ACCURATE = true
  31.  
  32.  
  33. local DOT_ENABLED = true
  34. local DOT_VISUAL_ENABLED = true
  35. local DOT_SIZE = 12
  36. local DOT_COLOR = Color3.fromRGB(0,255,170)
  37. local DOT_SPAWN_TIME = 0.12
  38. local DOT_DESPAWN_TIME = 0.08
  39.  
  40.  
  41. local PROXIMITY_FLICK_DISTANCE = 10
  42. local LEAD_FACTOR = 0.12
  43. local RETARGET_SCORE_THRESHOLD = 1.35
  44.  
  45.  
  46. local TARGET_SCAN_RATE = 0.06
  47. local OBSTRUCTION_RATE = 0.05
  48. local DISTANCE_RATE = 0.1
  49.  
  50. local lastTargetScan = 0
  51. local lastObstruction = 0
  52. local lastDistance = 0
  53.  
  54. local cachedBestTarget = nil
  55. local cachedBestScore = 0
  56. local cachedDistance = 0
  57. local cachedObstructed = false
  58.  
  59. local ALERT_DISTANCE = 60
  60.  
  61.  
  62. local CURRENT_TARGET = nil
  63.  
  64.  
  65. local UI_TOGGLE_KEY = Enum.KeyCode.Insert
  66. local UI_HIDDEN = false
  67. local WAITING_FOR_KEYBIND = false
  68.  
  69.  
  70. local ASSIST_TOGGLE_KEY = Enum.KeyCode.Q
  71. local HIGHLIGHTS_TOGGLE_KEY = Enum.KeyCode.E
  72.  
  73. local WAITING_FOR_ASSIST_KEYBIND = false
  74. local WAITING_FOR_HIGHLIGHTS_KEYBIND = false
  75.  
  76.  
  77. local ASSIST_TARGET_MODE = "HEAD"
  78.  
  79.  
  80. local ESP_ENABLED = false
  81. local ESP_SHOW_LABELS = true
  82. local ESP_RANGE = 500
  83. local ESP_RANGE_MIN = 50
  84. local ESP_RANGE_MAX = 2400
  85.  
  86.  
  87. local ESP_LABEL_RANGE = 220
  88. local ESP_LABEL_RANGE_MIN = 50
  89. local ESP_LABEL_RANGE_MAX = 900
  90.  
  91. local ESP_LABEL_TEXTSIZE = 16
  92. local ESP_LABEL_TEXTSIZE_MIN = 12
  93. local ESP_LABEL_TEXTSIZE_MAX = 22
  94.  
  95.  
  96. local ESP_FILL_COLOR = Color3.fromRGB(0, 0, 0)
  97. local ESP_FILL_TRANSPARENCY = 1
  98.  
  99.  
  100. local connections = {}
  101. local renderConnection = nil
  102.  
  103. local function connect(signal, fn)
  104. local c = signal:Connect(fn)
  105. table.insert(connections, c)
  106. return c
  107. end
  108.  
  109.  
  110. local espObjects = {}
  111. local dotObjects = {}
  112.  
  113. local function cleanupESPFor(zombie)
  114. local obj = espObjects[zombie]
  115. if not obj then return end
  116. if obj.billboard then obj.billboard:Destroy() end
  117. if obj.highlight then obj.highlight:Destroy() end
  118. espObjects[zombie] = nil
  119. end
  120.  
  121. local function cleanupDotFor(part)
  122. local obj = dotObjects[part]
  123. if not obj then return end
  124. if obj.billboard then obj.billboard:Destroy() end
  125. dotObjects[part] = nil
  126. end
  127.  
  128.  
  129. local gui = Instance.new("ScreenGui", player:WaitForChild("PlayerGui"))
  130. gui.ResetOnSpawn = false
  131. gui.IgnoreGuiInset = true
  132. gui.Name = "XENOMADETHISSHIT"
  133.  
  134.  
  135. local highlightsContainer = Instance.new("Folder")
  136. highlightsContainer.Name = "_ClientHighlights"
  137. highlightsContainer.Parent = Workspace
  138.  
  139.  
  140. local openBtn = Instance.new("TextButton", gui)
  141. openBtn.Size = UDim2.new(0, 100, 0, 40)
  142. openBtn.Position = UDim2.new(0.02, 0, 0.45, 0)
  143. openBtn.Text = "MENU"
  144. openBtn.TextScaled = true
  145. openBtn.BackgroundColor3 = Color3.fromRGB(40,40,40)
  146. openBtn.TextColor3 = Color3.new(1,1,1)
  147. openBtn.Font = Enum.Font.GothamBold
  148. Instance.new("UICorner", openBtn)
  149.  
  150.  
  151. local hub = Instance.new("Frame", gui)
  152. hub.Size = UDim2.new(0, 520, 0, 420)
  153. hub.Position = UDim2.new(0.08, 0, 0.5, -210)
  154. hub.BackgroundColor3 = Color3.fromRGB(20,20,20)
  155. hub.BorderSizePixel = 0
  156. hub.Visible = true
  157. Instance.new("UICorner", hub)
  158.  
  159. hub.BackgroundTransparency = 1
  160. openBtn.BackgroundTransparency = 1
  161. TweenService:Create(hub, TweenInfo.new(0.35), { BackgroundTransparency = 0 }):Play()
  162. TweenService:Create(openBtn, TweenInfo.new(0.35), { BackgroundTransparency = 0 }):Play()
  163.  
  164.  
  165. local titleBar = Instance.new("Frame", hub)
  166. titleBar.Size = UDim2.new(1, 0, 0, 55)
  167. titleBar.BackgroundColor3 = Color3.fromRGB(30,30,30)
  168. titleBar.BorderSizePixel = 0
  169. Instance.new("UICorner", titleBar)
  170.  
  171. local title = Instance.new("TextLabel", titleBar)
  172. title.Size = UDim2.new(1, 0, 1, 0)
  173. title.Text = "KILL THEM"
  174. title.TextScaled = true
  175. title.TextColor3 = Color3.fromRGB(180, 90, 255)
  176. title.BackgroundTransparency = 1
  177. title.Font = Enum.Font.GothamBold
  178.  
  179. local dragging = false
  180. local dragStart, startPos
  181.  
  182. connect(titleBar.InputBegan, function(input)
  183. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  184. dragging = true
  185. dragStart = input.Position
  186. startPos = hub.Position
  187. end
  188. end)
  189.  
  190. connect(UserInputService.InputEnded, function(input)
  191. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  192. dragging = false
  193. end
  194. end)
  195.  
  196. connect(UserInputService.InputChanged, function(input)
  197. if dragging and input.UserInputType == Enum.UserInputType.MouseMovement then
  198. local delta = input.Position - dragStart
  199. hub.Position = UDim2.new(
  200. startPos.X.Scale,
  201. startPos.X.Offset + delta.X,
  202. startPos.Y.Scale,
  203. startPos.Y.Offset + delta.Y
  204. )
  205. end
  206. end)
  207.  
  208.  
  209. local fovCircle = Instance.new("Frame", gui)
  210. fovCircle.AnchorPoint = Vector2.new(0.5, 0.5)
  211. fovCircle.BackgroundTransparency = 1
  212. Instance.new("UICorner", fovCircle).CornerRadius = UDim.new(1,0)
  213.  
  214. local fovStroke = Instance.new("UIStroke", fovCircle)
  215. fovStroke.Thickness = 2
  216. fovStroke.Color = Color3.new(1,1,1)
  217.  
  218.  
  219. local edgeArrow = Instance.new("ImageLabel")
  220. edgeArrow.Name = "_EdgeArrow"
  221. edgeArrow.AnchorPoint = Vector2.new(0.5,0.5)
  222. edgeArrow.BackgroundTransparency = 1
  223. edgeArrow.Image = "rbxassetid://6034818372"
  224. edgeArrow.Size = UDim2.new(0,40,0,40)
  225. edgeArrow.Visible = false
  226. edgeArrow.ImageTransparency = 1
  227. edgeArrow.Parent = gui
  228.  
  229. local arrowVisible = false
  230. local arrowTween
  231.  
  232. local function setArrowVisible(state)
  233. if arrowVisible == state then return end
  234. arrowVisible = state
  235. if arrowTween then arrowTween:Cancel() end
  236. if state then
  237. edgeArrow.Visible = true
  238. arrowTween = TweenService:Create(edgeArrow,TweenInfo.new(0.18),{ImageTransparency=0})
  239. else
  240. arrowTween = TweenService:Create(edgeArrow,TweenInfo.new(0.15),{ImageTransparency=1})
  241. arrowTween.Completed:Connect(function()
  242. edgeArrow.Visible = false
  243. end)
  244. end
  245. arrowTween:Play()
  246. end
  247.  
  248.  
  249. local bossGlow = Instance.new("Frame")
  250. bossGlow.Size = UDim2.new(1,0,1,0)
  251. bossGlow.BackgroundColor3 = Color3.fromRGB(255,70,70)
  252. bossGlow.BackgroundTransparency = 1
  253. bossGlow.Parent = gui
  254.  
  255. local glowTween
  256. local glowActive = false
  257.  
  258. local function setGlow(state)
  259. if glowActive == state then return end
  260. glowActive = state
  261. if glowTween then glowTween:Cancel() end
  262.  
  263. if state then
  264. bossGlow.BackgroundTransparency = 0.9
  265. glowTween = TweenService:Create(
  266. bossGlow,
  267. TweenInfo.new(0.7,Enum.EasingStyle.Sine,Enum.EasingDirection.InOut,-1,true),
  268. {BackgroundTransparency=0.75}
  269. )
  270. glowTween:Play()
  271. else
  272. bossGlow.BackgroundTransparency = 1
  273. end
  274. end
  275.  
  276.  
  277. local alertFrame = Instance.new("Frame")
  278. alertFrame.Size = UDim2.new(0,380,0,44)
  279. alertFrame.Position = UDim2.new(0.5,-190,0,-70)
  280. alertFrame.BackgroundColor3 = Color3.fromRGB(20,20,20)
  281. alertFrame.BackgroundTransparency = 0.1
  282. alertFrame.Visible = false
  283. alertFrame.Parent = gui
  284. Instance.new("UICorner",alertFrame)
  285.  
  286. local alertStroke = Instance.new("UIStroke",alertFrame)
  287. alertStroke.Thickness = 2
  288.  
  289. local alertText = Instance.new("TextLabel",alertFrame)
  290. alertText.Size = UDim2.new(1,-12,1,0)
  291. alertText.Position = UDim2.new(0,6,0,0)
  292. alertText.BackgroundTransparency = 1
  293. alertText.TextScaled = true
  294. alertText.Font = Enum.Font.GothamBold
  295. alertText.TextColor3 = Color3.new(1,1,1)
  296.  
  297. local alertActive = false
  298. local alertTween
  299.  
  300. local function setAlert(state)
  301. if alertActive == state then return end
  302. alertActive = state
  303. if alertTween then alertTween:Cancel() end
  304.  
  305. if state then
  306. alertFrame.Visible = true
  307. alertTween = TweenService:Create(alertFrame,TweenInfo.new(0.25),{
  308. Position = UDim2.new(0.5,-190,0,20)
  309. })
  310. else
  311. alertTween = TweenService:Create(alertFrame,TweenInfo.new(0.25),{
  312. Position = UDim2.new(0.5,-190,0,-70)
  313. })
  314. alertTween.Completed:Connect(function()
  315. alertFrame.Visible = false
  316. end)
  317. end
  318.  
  319. alertTween:Play()
  320. end
  321.  
  322.  
  323. local BOSS_NAMES = {
  324. ["Boss"] = true,
  325. ["SwampGiant"] = true,
  326. }
  327.  
  328. local SPECIAL_NAMES = {
  329. ["Destroyer"] = true,
  330. ["Berserker"] = true,
  331. ["Hunter"] = true,
  332. ["GuardianZombie"] = true,
  333. ["Annihilator"] = true,
  334. ["ElectricZombie"] = true,
  335. ["ToxicZombie"] = true,
  336. ["Flamer"] = true,
  337. ["Wraith"] = true,
  338. ["DrenchWraith"] = true,
  339. ["ArmouredZombie"] = true,
  340. ["HelmetZombie"] = true,
  341. ["HeavyArmourZombie"] = true,
  342. ["Boomer"] = true,
  343. ["Slasher"] = true,
  344. ["Crawler"] = true,
  345. ["HeadlessZombie"] = true,
  346. ["RiotZombie"] = true,
  347. ["LongArm"] = true,
  348. ["LongerArm"] = true,
  349. ["Lurker"] = true,
  350. ["SniperZombie"] = true,
  351. ["MinerZombie"] = true,
  352. ["Sponger"] = true,
  353. }
  354.  
  355. local DISPLAY_NAME_OVERRIDES = {}
  356.  
  357. local function getDisplayName(zombie)
  358. return DISPLAY_NAME_OVERRIDES[zombie.Name] or zombie.Name
  359. end
  360.  
  361.  
  362. local COLOR_PRESETS = {
  363. { name = "CYAN", c = Color3.fromRGB(0, 255, 170) },
  364. { name = "GREEN", c = Color3.fromRGB(0, 255, 0) },
  365. { name = "RED", c = Color3.fromRGB(255, 70, 70) },
  366. { name = "PURPLE", c = Color3.fromRGB(180, 90, 255) },
  367. { name = "YELLOW", c = Color3.fromRGB(255, 235, 80) },
  368. { name = "WHITE", c = Color3.fromRGB(255, 255, 255) },
  369. }
  370.  
  371. local MENU_COLOR_INDEX = 4
  372. local ACCENT_COLOR = COLOR_PRESETS[MENU_COLOR_INDEX].c
  373.  
  374. local NORMAL_COLOR_INDEX = 1
  375. local SPECIAL_COLOR_INDEX = 5
  376. local BOSS_COLOR_INDEX = 3
  377.  
  378. local function getPresetColor(index) return COLOR_PRESETS[index].c end
  379. local function getPresetName(index) return COLOR_PRESETS[index].name end
  380.  
  381.  
  382. local ESP_FILL_COLOR = Color3.fromRGB(0, 0, 0)
  383. local ESP_FILL_TRANSPARENCY = 1
  384.  
  385.  
  386. title.TextColor3 = ACCENT_COLOR
  387. fovStroke.Color = Color3.new(1,1,1)
  388.  
  389.  
  390. connect(openBtn.MouseButton1Click, function()
  391. GUI_VISIBLE = not GUI_VISIBLE
  392. hub.Visible = GUI_VISIBLE and (not UI_HIDDEN)
  393. end)
  394.  
  395.  
  396. local body = Instance.new("Frame", hub)
  397. body.Size = UDim2.new(1, -20, 1, -75)
  398. body.Position = UDim2.new(0, 10, 0, 65)
  399. body.BackgroundTransparency = 1
  400.  
  401. local sideBar = Instance.new("Frame", body)
  402. sideBar.Size = UDim2.new(0, 110, 1, 0)
  403. sideBar.BackgroundColor3 = Color3.fromRGB(18,18,18)
  404. sideBar.BorderSizePixel = 0
  405. Instance.new("UICorner", sideBar)
  406.  
  407. local content = Instance.new("Frame", body)
  408. content.Size = UDim2.new(1, -125, 1, 0)
  409. content.Position = UDim2.new(0, 125, 0, 0)
  410. content.BackgroundTransparency = 1
  411.  
  412. local function makeSideTab(text, y, big)
  413. local btn = Instance.new("TextButton", sideBar)
  414. btn.Size = UDim2.new(1, -14, 0, big and 64 or 44)
  415. btn.Position = UDim2.new(0, 7, 0, y)
  416. btn.Text = text
  417. btn.TextScaled = true
  418. btn.BackgroundColor3 = Color3.fromRGB(60,60,60)
  419. btn.TextColor3 = Color3.new(1,1,1)
  420. btn.Font = Enum.Font.GothamBold
  421. Instance.new("UICorner", btn)
  422. return btn
  423. end
  424.  
  425. local aimTabBtn = makeSideTab("AIM", 10, true)
  426. local espTabBtn = makeSideTab("ESP", 84, true)
  427. local settingsTabBtn = makeSideTab("SETTINGS", 158, false)
  428.  
  429.  
  430. local function makeScrollingTab(parent, visible)
  431. local tab = Instance.new("ScrollingFrame", parent)
  432. tab.Size = UDim2.new(1, 0, 1, 0)
  433. tab.BackgroundTransparency = 1
  434. tab.BorderSizePixel = 0
  435. tab.ScrollBarThickness = 6
  436. tab.ScrollingDirection = Enum.ScrollingDirection.Y
  437. tab.AutomaticCanvasSize = Enum.AutomaticSize.Y
  438. tab.CanvasSize = UDim2.new(0, 0, 0, 0)
  439. tab.Visible = visible
  440.  
  441. local pad = Instance.new("UIPadding", tab)
  442. pad.PaddingTop = UDim.new(0, 6)
  443. pad.PaddingBottom = UDim.new(0, 10)
  444. pad.PaddingLeft = UDim.new(0, 6)
  445. pad.PaddingRight = UDim.new(0, 6)
  446.  
  447. return tab
  448. end
  449.  
  450. local aimTab = makeScrollingTab(content, true)
  451. local espTab = makeScrollingTab(content, false)
  452. local settingsTab = makeScrollingTab(content, false)
  453.  
  454. local scrollTabs = { aimTab, espTab, settingsTab }
  455.  
  456. local function applyScrollTheme()
  457. for _, sf in ipairs(scrollTabs) do
  458. if sf and sf.Parent then
  459. sf.ScrollBarImageColor3 = ACCENT_COLOR
  460. sf.ScrollBarImageTransparency = 0.15
  461. end
  462. end
  463. end
  464.  
  465. local function setActiveTab(tabName)
  466. local isAim = (tabName == "AIM")
  467. local isEsp = (tabName == "ESP")
  468. local isSettings = (tabName == "SETTINGS")
  469.  
  470. aimTab.Visible = isAim
  471. espTab.Visible = isEsp
  472. settingsTab.Visible = isSettings
  473.  
  474. local activeCol = Color3.fromRGB(0,180,120)
  475. aimTabBtn.BackgroundColor3 = isAim and activeCol or Color3.fromRGB(60,60,60)
  476. espTabBtn.BackgroundColor3 = isEsp and activeCol or Color3.fromRGB(60,60,60)
  477. settingsTabBtn.BackgroundColor3 = isSettings and activeCol or Color3.fromRGB(60,60,60)
  478. end
  479.  
  480. setActiveTab("AIM")
  481. connect(aimTabBtn.MouseButton1Click, function() setActiveTab("AIM") end)
  482. connect(espTabBtn.MouseButton1Click, function() setActiveTab("ESP") end)
  483. connect(settingsTabBtn.MouseButton1Click, function() setActiveTab("SETTINGS") end)
  484.  
  485.  
  486. local function addListLayout(parent, padding)
  487. local list = Instance.new("UIListLayout", parent)
  488. list.FillDirection = Enum.FillDirection.Vertical
  489. list.HorizontalAlignment = Enum.HorizontalAlignment.Center
  490. list.SortOrder = Enum.SortOrder.LayoutOrder
  491. list.Padding = UDim.new(0, padding or 10)
  492. return list
  493. end
  494.  
  495. addListLayout(aimTab, 12)
  496. addListLayout(espTab, 10)
  497. addListLayout(settingsTab, 12)
  498.  
  499. local layoutOrders = {}
  500. local function nextOrder(parent)
  501. layoutOrders[parent] = (layoutOrders[parent] or 0) + 1
  502. return layoutOrders[parent]
  503. end
  504.  
  505. local function makeButton(parent, text)
  506. local btn = Instance.new("TextButton", parent)
  507. btn.Size = UDim2.new(1, -10, 0, 44)
  508. btn.Text = text
  509. btn.TextScaled = true
  510. btn.BackgroundColor3 = Color3.fromRGB(60,60,60)
  511. btn.TextColor3 = Color3.new(1,1,1)
  512. btn.Font = Enum.Font.GothamBold
  513. btn.AutoButtonColor = true
  514. btn.LayoutOrder = nextOrder(parent)
  515. Instance.new("UICorner", btn)
  516. return btn
  517. end
  518.  
  519. local function makeSlider(parent, labelText)
  520. local holder = Instance.new("Frame", parent)
  521. holder.Size = UDim2.new(1, -10, 0, 70)
  522. holder.BackgroundTransparency = 1
  523. holder.LayoutOrder = nextOrder(parent)
  524.  
  525. local label = Instance.new("TextLabel", holder)
  526. label.Size = UDim2.new(1, 0, 0, 20)
  527. label.Position = UDim2.new(0, 0, 0, 0)
  528. label.Text = labelText
  529. label.TextScaled = true
  530. label.TextColor3 = Color3.new(1,1,1)
  531. label.BackgroundTransparency = 1
  532. label.Font = Enum.Font.GothamBold
  533.  
  534. local bar = Instance.new("Frame", holder)
  535. bar.Size = UDim2.new(1, 0, 0, 10)
  536. bar.Position = UDim2.new(0, 0, 0, 32)
  537. bar.BackgroundColor3 = Color3.fromRGB(80,80,80)
  538. Instance.new("UICorner", bar)
  539.  
  540. local fill = Instance.new("Frame", bar)
  541. fill.Size = UDim2.new(0.5, 0, 1, 0)
  542. fill.BackgroundColor3 = ACCENT_COLOR
  543. Instance.new("UICorner", fill)
  544.  
  545. return bar, fill, holder
  546. end
  547.  
  548.  
  549. local activeSlider = nil
  550.  
  551. local function hookSlider(bar, fill, minVal, maxVal, onChange)
  552. connect(bar.InputBegan, function(input)
  553. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  554. activeSlider = {bar = bar, fill = fill, minVal = minVal, maxVal = maxVal, onChange = onChange}
  555. end
  556. end)
  557. end
  558.  
  559. connect(UserInputService.InputEnded, function(input)
  560. if input.UserInputType == Enum.UserInputType.MouseButton1 then
  561. activeSlider = nil
  562. end
  563. end)
  564.  
  565. connect(UserInputService.InputChanged, function(input)
  566. if activeSlider and input.UserInputType == Enum.UserInputType.MouseMovement then
  567. local bar = activeSlider.bar
  568. local fill = activeSlider.fill
  569.  
  570. local alpha = math.clamp((input.Position.X - bar.AbsolutePosition.X) / bar.AbsoluteSize.X, 0, 1)
  571. fill.Size = UDim2.new(alpha, 0, 1, 0)
  572.  
  573. local value = activeSlider.minVal + (activeSlider.maxVal - activeSlider.minVal) * alpha
  574. activeSlider.onChange(value)
  575. end
  576. end)
  577.  
  578.  
  579. local sliderFills = {}
  580. local function registerFill(fill) table.insert(sliderFills, fill) end
  581.  
  582. local function color3ToHSV(c) return Color3.toHSV(c) end
  583. 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
  584.  
  585. local function hexToColor3(hex)
  586. hex = tostring(hex):gsub("#","")
  587. if #hex == 3 then
  588. 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)
  589. end
  590. if #hex ~= 6 then return nil end
  591. local r = tonumber(hex:sub(1,2),16)
  592. local g = tonumber(hex:sub(3,4),16)
  593. local b = tonumber(hex:sub(5,6),16)
  594. if not (r and g and b) then return nil end
  595. return Color3.fromRGB(r,g,b)
  596. end
  597.  
  598. local function color3ToHex(c)
  599. local r = math.floor(c.R * 255 + 0.5)
  600. local g = math.floor(c.G * 255 + 0.5)
  601. local b = math.floor(c.B * 255 + 0.5)
  602. return string.format("%02X%02X%02X", r,g,b)
  603. end
  604.  
  605. local function createColorPicker(parent, labelText, initialColor, onChange)
  606. local holder = Instance.new("Frame", parent)
  607. holder.Size = UDim2.new(1, -10, 0, 120)
  608. holder.BackgroundTransparency = 1
  609. holder.LayoutOrder = nextOrder(parent)
  610.  
  611. local label = Instance.new("TextLabel", holder)
  612. label.Size = UDim2.new(1, 0, 0, 20)
  613. label.Text = labelText
  614. label.TextScaled = true
  615. label.BackgroundTransparency = 1
  616. label.TextColor3 = Color3.new(1,1,1)
  617. label.Font = Enum.Font.GothamBold
  618.  
  619. local hBar, hFill = makeSlider(holder, "H")
  620. local sBar, sFill = makeSlider(holder, "S")
  621. local vBar, vFill = makeSlider(holder, "V")
  622. hBar.Parent.Position = UDim2.new(0,0,0,22)
  623. sBar.Parent.Position = UDim2.new(0,0,0,50)
  624. vBar.Parent.Position = UDim2.new(0,0,0,78)
  625.  
  626. registerFill(hFill); registerFill(sFill); registerFill(vFill)
  627.  
  628. local hexBox = Instance.new("TextBox", holder)
  629. hexBox.Size = UDim2.new(0.4, 0, 0, 24)
  630. hexBox.Position = UDim2.new(0.58, 0, 0.02, 0)
  631. hexBox.Text = color3ToHex(initialColor)
  632. hexBox.Font = Enum.Font.Gotham
  633. hexBox.TextSize = 14
  634. hexBox.PlaceholderText = "HEX"
  635. hexBox.BackgroundColor3 = Color3.fromRGB(50,50,50)
  636. hexBox.TextColor3 = Color3.new(1,1,1)
  637. Instance.new("UICorner", hexBox)
  638.  
  639. local preview = Instance.new("Frame", holder)
  640. preview.Size = UDim2.new(0.15, 0, 0, 34)
  641. preview.Position = UDim2.new(0.82, 0, 0.02, 0)
  642. preview.BackgroundColor3 = initialColor
  643. Instance.new("UICorner", preview)
  644.  
  645. local h,s,v = color3ToHSV(initialColor)
  646. local function commit()
  647. local col = hsvToColor3(h,s,v)
  648. preview.BackgroundColor3 = col
  649. hexBox.Text = color3ToHex(col)
  650. if onChange then pcall(onChange, col) end
  651. end
  652.  
  653. local function setSliders()
  654. hFill.Size = UDim2.new(h,0,1,0)
  655. sFill.Size = UDim2.new(s,0,1,0)
  656. vFill.Size = UDim2.new(v,0,1,0)
  657. end
  658.  
  659. hookSlider(hBar, hFill, 0, 1, function(vv) h = vv setSliders() commit() end)
  660. hookSlider(sBar, sFill, 0, 1, function(vv) s = vv setSliders() commit() end)
  661. hookSlider(vBar, vFill, 0, 1, function(vv) v = vv setSliders() commit() end)
  662.  
  663. hexBox.FocusLost:Connect(function()
  664. local c = hexToColor3(hexBox.Text)
  665. if c then
  666. h,s,v = color3ToHSV(c)
  667. setSliders()
  668. commit()
  669. else
  670. hexBox.Text = color3ToHex(preview.BackgroundColor3)
  671. end
  672. end)
  673.  
  674. setSliders()
  675. commit()
  676.  
  677. return function(col)
  678. if not col then return end
  679. h,s,v = color3ToHSV(col)
  680. setSliders()
  681. commit()
  682. end
  683. end
  684.  
  685.  
  686. local function applyAccent()
  687. title.TextColor3 = ACCENT_COLOR
  688. for _, fill in ipairs(sliderFills) do
  689. if fill and fill.Parent then
  690. fill.BackgroundColor3 = ACCENT_COLOR
  691. end
  692. end
  693. applyScrollTheme()
  694. end
  695.  
  696. applyAccent()
  697.  
  698.  
  699. local aimBtn = makeButton(aimTab, "AIM: OFF")
  700. connect(aimBtn.MouseButton1Click, function()
  701. AIM_ENABLED = not AIM_ENABLED
  702. if not AIM_ENABLED then
  703. CURRENT_TARGET = nil
  704. end
  705. aimBtn.Text = AIM_ENABLED and "AIM: ON" or "AIM: OFF"
  706. aimBtn.BackgroundColor3 = AIM_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
  707. end)
  708.  
  709. local fovBtn = makeButton(aimTab, "FOV CIRCLE: ON")
  710. connect(fovBtn.MouseButton1Click, function()
  711. FOV_CIRCLE_ENABLED = not FOV_CIRCLE_ENABLED
  712. fovBtn.Text = FOV_CIRCLE_ENABLED and "FOV CIRCLE: ON" or "FOV CIRCLE: OFF"
  713. end)
  714.  
  715. local fovBar, fovFill = makeSlider(aimTab, "FOV SIZE")
  716. registerFill(fovFill)
  717. hookSlider(fovBar, fovFill, FOV_MIN, FOV_MAX, function(v) FOV_RADIUS = v end)
  718.  
  719. local smoothBar, smoothFill = makeSlider(aimTab, "SMOOTHNESS")
  720. registerFill(smoothFill)
  721. hookSlider(smoothBar, smoothFill, SMOOTH_MIN, SMOOTH_MAX, function(v) SMOOTHNESS = v end)
  722.  
  723. local dotToggleBtn = makeButton(aimTab, "TRACK DOT: ON")
  724. connect(dotToggleBtn.MouseButton1Click, function()
  725. DOT_ENABLED = not DOT_ENABLED
  726. dotToggleBtn.Text = DOT_ENABLED and "TRACK DOT: ON" or "TRACK DOT: OFF"
  727. end)
  728.  
  729. local dotVisualBtn = makeButton(aimTab, "DOT VISIBLE: ON")
  730. connect(dotVisualBtn.MouseButton1Click, function()
  731. DOT_VISUAL_ENABLED = not DOT_VISUAL_ENABLED
  732. dotVisualBtn.Text = DOT_VISUAL_ENABLED and "DOT VISIBLE: ON" or "DOT VISIBLE: OFF"
  733. end)
  734.  
  735. local dotSizeBar, dotSizeFill = makeSlider(aimTab, "DOT SIZE")
  736. registerFill(dotSizeFill)
  737. hookSlider(dotSizeBar, dotSizeFill, 4, 64, function(v) DOT_SIZE = math.floor(v) end)
  738.  
  739. local setDotColorExternally = createColorPicker(aimTab, "DOT COLOR", DOT_COLOR, function(col)
  740. DOT_COLOR = col
  741. for part, d in pairs(dotObjects) do
  742. if d and d.frame then
  743. d.frame.BackgroundColor3 = DOT_COLOR
  744. end
  745. end
  746. end)
  747. setDotColorExternally(DOT_COLOR)
  748.  
  749.  
  750. local espBtn = makeButton(espTab, "ESP: OFF")
  751. connect(espBtn.MouseButton1Click, function()
  752. ESP_ENABLED = not ESP_ENABLED
  753. espBtn.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
  754. espBtn.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
  755. end)
  756.  
  757. local labelBtn = makeButton(espTab, "LABELS: ON")
  758. connect(labelBtn.MouseButton1Click, function()
  759. ESP_SHOW_LABELS = not ESP_SHOW_LABELS
  760. labelBtn.Text = ESP_SHOW_LABELS and "LABELS: ON" or "LABELS: OFF"
  761. end)
  762.  
  763. local normalColorBtn = makeButton(espTab, "NORMAL COLOR: " .. getPresetName(NORMAL_COLOR_INDEX))
  764. connect(normalColorBtn.MouseButton1Click, function()
  765. NORMAL_COLOR_INDEX += 1
  766. if NORMAL_COLOR_INDEX > #COLOR_PRESETS then NORMAL_COLOR_INDEX = 1 end
  767. normalColorBtn.Text = "NORMAL COLOR: " .. getPresetName(NORMAL_COLOR_INDEX)
  768. end)
  769.  
  770. local specialColorBtn = makeButton(espTab, "SPECIAL COLOR: " .. getPresetName(SPECIAL_COLOR_INDEX))
  771. connect(specialColorBtn.MouseButton1Click, function()
  772. SPECIAL_COLOR_INDEX += 1
  773. if SPECIAL_COLOR_INDEX > #COLOR_PRESETS then SPECIAL_COLOR_INDEX = 1 end
  774. specialColorBtn.Text = "SPECIAL COLOR: " .. getPresetName(SPECIAL_COLOR_INDEX)
  775. end)
  776.  
  777. local bossColorBtn = makeButton(espTab, "BOSS COLOR: " .. getPresetName(BOSS_COLOR_INDEX))
  778. connect(bossColorBtn.MouseButton1Click, function()
  779. BOSS_COLOR_INDEX += 1
  780. if BOSS_COLOR_INDEX > #COLOR_PRESETS then BOSS_COLOR_INDEX = 1 end
  781. bossColorBtn.Text = "BOSS COLOR: " .. getPresetName(BOSS_COLOR_INDEX)
  782. end)
  783.  
  784. local espRangeBar, espRangeFill = makeSlider(espTab, "ESP RANGE")
  785. registerFill(espRangeFill)
  786. hookSlider(espRangeBar, espRangeFill, ESP_RANGE_MIN, ESP_RANGE_MAX, function(v) ESP_RANGE = v end)
  787.  
  788. local labelRangeBar, labelRangeFill = makeSlider(espTab, "LABEL RANGE")
  789. registerFill(labelRangeFill)
  790. hookSlider(labelRangeBar, labelRangeFill, ESP_LABEL_RANGE_MIN, ESP_LABEL_RANGE_MAX, function(v) ESP_LABEL_RANGE = v end)
  791.  
  792. local labelSizeBar, labelSizeFill = makeSlider(espTab, "LABEL SIZE")
  793. registerFill(labelSizeFill)
  794. hookSlider(labelSizeBar, labelSizeFill, ESP_LABEL_TEXTSIZE_MIN, ESP_LABEL_TEXTSIZE_MAX, function(v)
  795. ESP_LABEL_TEXTSIZE = math.floor(v)
  796. end)
  797.  
  798.  
  799. local menuColorBtn = makeButton(settingsTab, "MENU COLOR: " .. getPresetName(MENU_COLOR_INDEX))
  800. connect(menuColorBtn.MouseButton1Click, function()
  801. MENU_COLOR_INDEX += 1
  802. if MENU_COLOR_INDEX > #COLOR_PRESETS then MENU_COLOR_INDEX = 1 end
  803. menuColorBtn.Text = "MENU COLOR: " .. getPresetName(MENU_COLOR_INDEX)
  804. ACCENT_COLOR = getPresetColor(MENU_COLOR_INDEX)
  805. applyAccent()
  806. end)
  807.  
  808. local setAccentExternally = createColorPicker(settingsTab, "MENU ACCENT COLOR", ACCENT_COLOR, function(col)
  809. ACCENT_COLOR = col
  810. applyAccent()
  811. end)
  812.  
  813. local keybindBtn = makeButton(settingsTab, "UI KEY: " .. tostring(UI_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
  814. connect(keybindBtn.MouseButton1Click, function()
  815. WAITING_FOR_KEYBIND = true
  816. keybindBtn.Text = "PRESS A KEY..."
  817. keybindBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
  818. end)
  819.  
  820. local assistKeyBtn = makeButton(settingsTab, "ASSIST KEY: " .. tostring(ASSIST_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
  821. connect(assistKeyBtn.MouseButton1Click, function()
  822. WAITING_FOR_ASSIST_KEYBIND = true
  823. assistKeyBtn.Text = "PRESS A KEY..."
  824. assistKeyBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
  825. end)
  826.  
  827. local highlightsKeyBtn = makeButton(settingsTab, "HIGHLIGHTS KEY: " .. tostring(HIGHLIGHTS_TOGGLE_KEY):gsub("Enum.KeyCode.", ""))
  828. connect(highlightsKeyBtn.MouseButton1Click, function()
  829. WAITING_FOR_HIGHLIGHTS_KEYBIND = true
  830. highlightsKeyBtn.Text = "PRESS A KEY..."
  831. highlightsKeyBtn.BackgroundColor3 = Color3.fromRGB(0,180,120)
  832. end)
  833.  
  834. local assistTargetBtn = makeButton(settingsTab, "ASSIST TARGET: " .. ASSIST_TARGET_MODE)
  835. connect(assistTargetBtn.MouseButton1Click, function()
  836.  
  837. ASSIST_TARGET_MODE = (ASSIST_TARGET_MODE == "HEAD") and "TORSO" or "HEAD"
  838. assistTargetBtn.Text = "ASSIST TARGET: " .. ASSIST_TARGET_MODE
  839.  
  840.  
  841. if CURRENT_TARGET and CURRENT_TARGET.Parent then
  842. local zombie = CURRENT_TARGET.Parent
  843. local newPart = getAssistPart(zombie)
  844. if newPart and newPart ~= CURRENT_TARGET then
  845.  
  846. if dotObjects and dotObjects[CURRENT_TARGET] then
  847. despawnDotForPart(CURRENT_TARGET)
  848. end
  849. CURRENT_TARGET = newPart
  850. end
  851. end
  852.  
  853. end)
  854.  
  855. local setHighlightColorExternally = createColorPicker(settingsTab, "HIGHLIGHT OUTLINE COLOR", getPresetColor(NORMAL_COLOR_INDEX), function(col)
  856. for _, obj in pairs(espObjects) do
  857. if obj.highlight then
  858. obj.highlight.OutlineColor = col
  859. end
  860. end
  861. end)
  862.  
  863.  
  864. local setDotColorFromSettings = createColorPicker(settingsTab, "DOT COLOR (ALT)", DOT_COLOR, function(col)
  865. DOT_COLOR = col
  866. for part, d in pairs(dotObjects) do
  867. if d and d.frame then
  868. d.frame.BackgroundColor3 = DOT_COLOR
  869. end
  870. end
  871. end)
  872.  
  873.  
  874. local unloadBtn = makeButton(settingsTab, "UNLOAD")
  875.  
  876.  
  877. setAccentExternally(ACCENT_COLOR)
  878. applyAccent()
  879.  
  880.  
  881. local function getAimPart(zombie)
  882. return zombie:FindFirstChild("HumanoidRootPart")
  883. or zombie:FindFirstChild("Torso")
  884. or zombie:FindFirstChild("Head")
  885. end
  886.  
  887. local function getAssistPart(zombie)
  888. if ASSIST_TARGET_MODE == "HEAD" then
  889. return zombie:FindFirstChild("Head")
  890. or zombie:FindFirstChild("HumanoidRootPart")
  891. or zombie:FindFirstChild("Torso")
  892. else
  893. return zombie:FindFirstChild("Torso")
  894. or zombie:FindFirstChild("HumanoidRootPart")
  895. or zombie:FindFirstChild("Head")
  896. end
  897. end
  898.  
  899.  
  900. local function computeThreatScore(part)
  901. if not part or not part.Parent then return 0 end
  902.  
  903. local camPos = camera.CFrame.Position
  904. local worldDist = (camPos - part.Position).Magnitude
  905. if worldDist > MAX_LOCK_DISTANCE then return 0 end
  906.  
  907. local screenPos, onScreen = camera:WorldToViewportPoint(part.Position)
  908. if not onScreen then return 0 end
  909.  
  910. local center = Vector2.new(camera.ViewportSize.X/2, camera.ViewportSize.Y/2)
  911. local screenDist = (Vector2.new(screenPos.X, screenPos.Y) - center).Magnitude
  912.  
  913.  
  914. local v = Vector3.new()
  915. local root = part.Parent:FindFirstChild("HumanoidRootPart")
  916. if root then
  917.  
  918.  
  919. v = root.AssemblyLinearVelocity or root.Velocity
  920. end
  921.  
  922. local toPlayer = Vector3.new()
  923. if player.Character and player.Character.PrimaryPart then
  924. toPlayer = (player.Character.PrimaryPart.Position - part.Position)
  925. end
  926.  
  927. local approach = 0
  928. if v.Magnitude > 1 and toPlayer.Magnitude > 0 then
  929. approach = math.max(0, v.Unit:Dot(toPlayer.Unit))
  930. end
  931.  
  932.  
  933. local score = (1 / (worldDist + 1)) * (1 / (screenDist + 1)) * (1 + approach * 2)
  934.  
  935.  
  936. if worldDist <= PROXIMITY_FLICK_DISTANCE then
  937. score = score * 3.5
  938. end
  939.  
  940. return score
  941. end
  942.  
  943.  
  944. local function getBestZombieTarget()
  945. local folder = Workspace:FindFirstChild(ZOMBIE_FOLDER_NAME)
  946. if not folder then return nil, 0 end
  947.  
  948. local bestPart = nil
  949. local bestScore = 0
  950.  
  951. for _, zombie in ipairs(folder:GetChildren()) do
  952. local part = getAssistPart(zombie)
  953. local hum = zombie:FindFirstChildOfClass("Humanoid")
  954.  
  955. if part and hum and hum.Health > 0 then
  956. local score = computeThreatScore(part)
  957. if score > bestScore and score > 0 then
  958. bestScore = score
  959. bestPart = part
  960. end
  961. end
  962. end
  963.  
  964. return bestPart, bestScore
  965. end
  966.  
  967.  
  968. local function getZombieType(zombie)
  969. if BOSS_NAMES[zombie.Name] then return "BOSS" end
  970. if SPECIAL_NAMES[zombie.Name] then return "SPECIAL" end
  971.  
  972. local t = zombie:GetAttribute("Type")
  973. if t == "Boss" or t == "BOSS" then return "BOSS" end
  974. if t == "Special" or t == "SPECIAL" then return "SPECIAL" end
  975.  
  976. local isBoss = zombie:FindFirstChild("IsBoss")
  977. if isBoss and isBoss:IsA("BoolValue") and isBoss.Value == true then
  978. return "BOSS"
  979. end
  980.  
  981. local isSpecial = zombie:FindFirstChild("IsSpecial")
  982. if isSpecial and isSpecial:IsA("BoolValue") and isSpecial.Value == true then
  983. return "SPECIAL"
  984. end
  985.  
  986. return "NORMAL"
  987. end
  988.  
  989. local function getTypeColor(zType)
  990. if zType == "BOSS" then
  991. return getPresetColor(BOSS_COLOR_INDEX)
  992. end
  993. if zType == "SPECIAL" then
  994. return getPresetColor(SPECIAL_COLOR_INDEX)
  995. end
  996. return getPresetColor(NORMAL_COLOR_INDEX)
  997. end
  998.  
  999.  
  1000. local function ensureESPFor(zombie)
  1001. if espObjects[zombie] then
  1002. return espObjects[zombie]
  1003. end
  1004.  
  1005. local adorneePart = getAimPart(zombie)
  1006. if not adorneePart then return nil end
  1007.  
  1008. local h = Instance.new("Highlight")
  1009. h.Name = "_ClientHighlight"
  1010. h.Adornee = zombie
  1011. h.Parent = highlightsContainer
  1012. h.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  1013. h.FillColor = ESP_FILL_COLOR
  1014. h.FillTransparency = ESP_FILL_TRANSPARENCY
  1015. h.OutlineTransparency = 0
  1016.  
  1017. local bb = Instance.new("BillboardGui")
  1018. bb.Name = "_ClientBillboard"
  1019. bb.Adornee = adorneePart
  1020. bb.AlwaysOnTop = true
  1021. bb.Size = UDim2.new(0, 240, 0, 46)
  1022. bb.StudsOffset = Vector3.new(0, 2.8, 0)
  1023. bb.Parent = gui
  1024.  
  1025. local label = Instance.new("TextLabel", bb)
  1026. label.Size = UDim2.new(1, 0, 1, 0)
  1027. label.BackgroundTransparency = 1
  1028. label.TextStrokeTransparency = 0.35
  1029. label.TextScaled = false
  1030. label.TextSize = ESP_LABEL_TEXTSIZE
  1031. label.Font = Enum.Font.GothamBold
  1032. label.Text = getDisplayName(zombie)
  1033.  
  1034. espObjects[zombie] = {highlight = h, billboard = bb, label = label}
  1035. return espObjects[zombie]
  1036. end
  1037.  
  1038.  
  1039. local function createDotForPart(part)
  1040. if not part or not part.Parent then return nil end
  1041. if dotObjects[part] then return dotObjects[part] end
  1042.  
  1043. local bb = Instance.new("BillboardGui")
  1044. bb.Name = "_ClientTrackDot"
  1045. bb.Adornee = part
  1046. bb.AlwaysOnTop = true
  1047. bb.Size = UDim2.new(0, 0, 0, 0)
  1048. bb.StudsOffset = Vector3.new(0, 0.3, 0)
  1049. bb.Parent = gui
  1050.  
  1051. local dotFrame = Instance.new("Frame", bb)
  1052. dotFrame.Size = UDim2.new(1, 0, 1, 0)
  1053. dotFrame.BackgroundColor3 = DOT_COLOR
  1054. dotFrame.BorderSizePixel = 0
  1055. dotFrame.BackgroundTransparency = 1
  1056. local corner = Instance.new("UICorner", dotFrame)
  1057. corner.CornerRadius = UDim.new(1, 0)
  1058.  
  1059. dotObjects[part] = {billboard = bb, frame = dotFrame}
  1060.  
  1061.  
  1062. pcall(function()
  1063. local t1 = TweenService:Create(bb, TweenInfo.new(DOT_SPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
  1064. Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
  1065. })
  1066. local t2 = TweenService:Create(dotFrame, TweenInfo.new(DOT_SPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {
  1067. BackgroundTransparency = 0
  1068. })
  1069. t1:Play(); t2:Play()
  1070. end)
  1071.  
  1072. return dotObjects[part]
  1073. end
  1074.  
  1075. local function despawnDotForPart(part)
  1076. local obj = dotObjects[part]
  1077. if not obj then return end
  1078.  
  1079. pcall(function()
  1080. if obj.billboard then
  1081. TweenService:Create(obj.billboard, TweenInfo.new(DOT_DESPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
  1082. Size = UDim2.new(0,0,0,0)
  1083. }):Play()
  1084. end
  1085. if obj.frame then
  1086. TweenService:Create(obj.frame, TweenInfo.new(DOT_DESPAWN_TIME, Enum.EasingStyle.Quad, Enum.EasingDirection.In), {
  1087. BackgroundTransparency = 1
  1088. }):Play()
  1089. end
  1090. end)
  1091.  
  1092. task.delay(DOT_DESPAWN_TIME + 0.02, function()
  1093. pcall(function()
  1094. cleanupDotFor(part)
  1095. end)
  1096. end)
  1097. end
  1098.  
  1099. local function updateDotForPart(part)
  1100. local obj = dotObjects[part]
  1101. if not obj then return end
  1102.  
  1103. if obj.billboard then
  1104. obj.billboard.Size = UDim2.new(0, DOT_SIZE, 0, DOT_SIZE)
  1105. obj.billboard.Enabled = (AIM_ENABLED and DOT_ENABLED and DOT_VISUAL_ENABLED)
  1106. end
  1107. if obj.frame then
  1108. obj.frame.BackgroundColor3 = DOT_COLOR
  1109. obj.frame.BackgroundTransparency = DOT_VISUAL_ENABLED and 0 or 1
  1110. end
  1111. end
  1112.  
  1113. local function ensureDotForPart(part)
  1114. if dotObjects[part] then return dotObjects[part] end
  1115. return createDotForPart(part)
  1116. end
  1117.  
  1118.  
  1119. connect(UserInputService.InputBegan, function(input, gameProcessed)
  1120. if gameProcessed then return end
  1121.  
  1122.  
  1123. if WAITING_FOR_KEYBIND then
  1124. if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
  1125. UI_TOGGLE_KEY = input.KeyCode
  1126. WAITING_FOR_KEYBIND = false
  1127. keybindBtn.Text = "UI KEY: " .. tostring(UI_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
  1128. keybindBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
  1129. end
  1130. return
  1131. end
  1132.  
  1133.  
  1134. if WAITING_FOR_ASSIST_KEYBIND then
  1135. if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
  1136. ASSIST_TOGGLE_KEY = input.KeyCode
  1137. WAITING_FOR_ASSIST_KEYBIND = false
  1138. assistKeyBtn.Text = "ASSIST KEY: " .. tostring(ASSIST_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
  1139. assistKeyBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
  1140. end
  1141. return
  1142. end
  1143.  
  1144.  
  1145. if WAITING_FOR_HIGHLIGHTS_KEYBIND then
  1146. if input.UserInputType == Enum.UserInputType.Keyboard and input.KeyCode ~= Enum.KeyCode.Unknown then
  1147. HIGHLIGHTS_TOGGLE_KEY = input.KeyCode
  1148. WAITING_FOR_HIGHLIGHTS_KEYBIND = false
  1149. highlightsKeyBtn.Text = "HIGHLIGHTS KEY: " .. tostring(HIGHLIGHTS_TOGGLE_KEY):gsub("Enum.KeyCode.", "")
  1150. highlightsKeyBtn.BackgroundColor3 = Color3.fromRGB(60,60,60)
  1151. end
  1152. return
  1153. end
  1154.  
  1155.  
  1156. if input.KeyCode == ASSIST_TOGGLE_KEY then
  1157. AIM_ENABLED = not AIM_ENABLED
  1158.  
  1159. if not AIM_ENABLED then
  1160. for part, d in pairs(dotObjects) do
  1161. if d and d.billboard then
  1162. pcall(function()
  1163. TweenService:Create(d.billboard, TweenInfo.new(DOT_DESPAWN_TIME), {Size = UDim2.new(0,0,0,0)}):Play()
  1164. TweenService:Create(d.frame, TweenInfo.new(DOT_DESPAWN_TIME), {BackgroundTransparency = 1}):Play()
  1165. end)
  1166. end
  1167. end
  1168. CURRENT_TARGET = nil
  1169. end
  1170.  
  1171. aimBtn.Text = AIM_ENABLED and "AIM: ON" or "AIM: OFF"
  1172. aimBtn.BackgroundColor3 = AIM_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
  1173. return
  1174. end
  1175.  
  1176.  
  1177. if input.KeyCode == HIGHLIGHTS_TOGGLE_KEY then
  1178. ESP_ENABLED = not ESP_ENABLED
  1179. espBtn.Text = ESP_ENABLED and "ESP: ON" or "ESP: OFF"
  1180. espBtn.BackgroundColor3 = ESP_ENABLED and Color3.fromRGB(0,180,120) or Color3.fromRGB(60,60,60)
  1181. return
  1182. end
  1183.  
  1184.  
  1185. if input.KeyCode == UI_TOGGLE_KEY then
  1186. UI_HIDDEN = not UI_HIDDEN
  1187. openBtn.Visible = not UI_HIDDEN
  1188. hub.Visible = (not UI_HIDDEN) and GUI_VISIBLE
  1189. return
  1190. end
  1191. end)
  1192.  
  1193.  
  1194. local function fadeOutAndDestroy()
  1195. AIM_ENABLED = false
  1196. FOV_CIRCLE_ENABLED = false
  1197. ESP_ENABLED = false
  1198. CURRENT_TARGET = nil
  1199.  
  1200. setArrowVisible(false)
  1201. setGlow(false)
  1202. setAlert(false)
  1203.  
  1204. if renderConnection then
  1205. renderConnection:Disconnect()
  1206. renderConnection = nil
  1207. end
  1208.  
  1209. for zombie, _ in pairs(espObjects) do
  1210. pcall(function() cleanupESPFor(zombie) end)
  1211. end
  1212. for part, _ in pairs(dotObjects) do
  1213. pcall(function() cleanupDotFor(part) end)
  1214. end
  1215.  
  1216. for _, c in ipairs(connections) do
  1217. pcall(function() c:Disconnect() end)
  1218. end
  1219.  
  1220. pcall(function() highlightsContainer:Destroy() end)
  1221.  
  1222. local t1 = TweenService:Create(hub, TweenInfo.new(0.35), { BackgroundTransparency = 1 })
  1223. local t2 = TweenService:Create(openBtn, TweenInfo.new(0.35), { BackgroundTransparency = 1, TextTransparency = 1 })
  1224. t1:Play(); t2:Play()
  1225. pcall(function() t1.Completed:Wait() end)
  1226.  
  1227. pcall(function() gui:Destroy() end)
  1228. end
  1229.  
  1230. connect(unloadBtn.MouseButton1Click, fadeOutAndDestroy)
  1231.  
  1232.  
  1233. local obstructionParams = RaycastParams.new()
  1234. obstructionParams.FilterType = Enum.RaycastFilterType.Blacklist
  1235. obstructionParams.IgnoreWater = true
  1236.  
  1237. local function refreshObstructionFilter()
  1238. local char = player.Character
  1239. if char then
  1240. obstructionParams.FilterDescendantsInstances = { char }
  1241. else
  1242. obstructionParams.FilterDescendantsInstances = {}
  1243. end
  1244. end
  1245.  
  1246. refreshObstructionFilter()
  1247. connect(player.CharacterAdded, function()
  1248. task.defer(refreshObstructionFilter)
  1249. end)
  1250.  
  1251.  
  1252. renderConnection = RunService.RenderStepped:Connect(function(dt)
  1253.  
  1254. fovCircle.Visible = FOV_CIRCLE_ENABLED
  1255. fovCircle.Position = UDim2.new(0.5, 0, 0.5, 0)
  1256. fovCircle.Size = UDim2.new(0, FOV_RADIUS * 2, 0, FOV_RADIUS * 2)
  1257.  
  1258.  
  1259. if Workspace.CurrentCamera ~= camera then
  1260. camera = Workspace.CurrentCamera
  1261. end
  1262.  
  1263. local now = tick()
  1264.  
  1265.  
  1266. if AIM_ENABLED then
  1267. if now - lastTargetScan > TARGET_SCAN_RATE then
  1268. lastTargetScan = now
  1269. cachedBestTarget, cachedBestScore = getBestZombieTarget()
  1270. end
  1271.  
  1272. local found = cachedBestTarget
  1273. local bestScore = cachedBestScore
  1274.  
  1275.  
  1276. if not CURRENT_TARGET and found then
  1277. CURRENT_TARGET = found
  1278. elseif found and CURRENT_TARGET then
  1279. local currentScore = computeThreatScore(CURRENT_TARGET)
  1280.  
  1281. if found ~= CURRENT_TARGET then
  1282. if bestScore > (currentScore * RETARGET_SCORE_THRESHOLD) then
  1283. if dotObjects[CURRENT_TARGET] then
  1284. despawnDotForPart(CURRENT_TARGET)
  1285. end
  1286. CURRENT_TARGET = found
  1287. else
  1288.  
  1289. local worldDist = (camera.CFrame.Position - found.Position).Magnitude
  1290. if worldDist <= PROXIMITY_FLICK_DISTANCE then
  1291. if dotObjects[CURRENT_TARGET] then
  1292. despawnDotForPart(CURRENT_TARGET)
  1293. end
  1294. CURRENT_TARGET = found
  1295. end
  1296. end
  1297. end
  1298. elseif found and not CURRENT_TARGET then
  1299. CURRENT_TARGET = found
  1300. end
  1301.  
  1302.  
  1303. if CURRENT_TARGET then
  1304. local hum = CURRENT_TARGET.Parent and CURRENT_TARGET.Parent:FindFirstChildOfClass("Humanoid")
  1305. if (not hum) or hum.Health <= 0 or hum:GetState() == Enum.HumanoidStateType.Dead then
  1306. if dotObjects[CURRENT_TARGET] then
  1307. despawnDotForPart(CURRENT_TARGET)
  1308. end
  1309. CURRENT_TARGET = nil
  1310. end
  1311. end
  1312.  
  1313.  
  1314. if CURRENT_TARGET then
  1315. local camPos = camera.CFrame.Position
  1316.  
  1317. if now - lastDistance > DISTANCE_RATE then
  1318. lastDistance = now
  1319. cachedDistance = (camPos - CURRENT_TARGET.Position).Magnitude
  1320. end
  1321.  
  1322. if now - lastObstruction > OBSTRUCTION_RATE then
  1323. lastObstruction = now
  1324. local result = Workspace:Raycast(camPos, CURRENT_TARGET.Position - camPos, obstructionParams)
  1325. cachedObstructed = (result ~= nil) and (not result.Instance:IsDescendantOf(CURRENT_TARGET.Parent))
  1326. end
  1327. else
  1328. cachedObstructed = false
  1329. cachedDistance = 0
  1330. end
  1331. else
  1332.  
  1333. CURRENT_TARGET = nil
  1334. cachedObstructed = false
  1335. cachedDistance = 0
  1336. end
  1337.  
  1338.  
  1339. if AIM_ENABLED and CURRENT_TARGET then
  1340. fovStroke.Color = ACCENT_COLOR
  1341.  
  1342. local target = CURRENT_TARGET
  1343. local camPos = camera.CFrame.Position
  1344.  
  1345. local prediction = Vector3.new()
  1346. if AIM_PREDICTIVE then
  1347. local root = target.Parent and target.Parent:FindFirstChild("HumanoidRootPart")
  1348. if root then
  1349. local vel = root.AssemblyLinearVelocity or root.Velocity
  1350. prediction = vel * LEAD_FACTOR
  1351. end
  1352. end
  1353.  
  1354.  
  1355. local worldDist = cachedDistance > 0 and cachedDistance or (camPos - target.Position).Magnitude
  1356. local proximityFactor = math.clamp(1 - (worldDist / (PROXIMITY_FLICK_DISTANCE * 4)), 0, 1)
  1357.  
  1358. local smoothNorm = math.clamp((SMOOTHNESS - SMOOTH_MIN) / (SMOOTH_MAX - SMOOTH_MIN), 0, 1)
  1359. local baseLerp = 0.04 + (1 - smoothNorm) * 0.9
  1360. local lerpT = math.clamp(baseLerp * (1 - proximityFactor * 0.85), 0.02, 0.95)
  1361.  
  1362. if worldDist <= PROXIMITY_FLICK_DISTANCE then
  1363. lerpT = math.max(lerpT * 0.12, 0.02)
  1364. end
  1365.  
  1366. local targetPos = target.Position + prediction
  1367.  
  1368. if AIM_PIXEL_ACCURATE then
  1369. local screenPos, onScreen = camera:WorldToViewportPoint(targetPos)
  1370. if onScreen then
  1371. local ray = camera:ViewportPointToRay(screenPos.X, screenPos.Y)
  1372. local camToPart = targetPos - camPos
  1373. local depth = camToPart:Dot(camera.CFrame.LookVector)
  1374. if depth < 0.1 then depth = 0.1 end
  1375. targetPos = ray.Origin + ray.Direction * depth
  1376. end
  1377. end
  1378.  
  1379. camera.CFrame = camera.CFrame:Lerp(CFrame.new(camPos, targetPos), math.clamp(1 - lerpT, 0.02, 0.995))
  1380. else
  1381. fovStroke.Color = Color3.new(1,1,1)
  1382. end
  1383.  
  1384.  
  1385. local folder = Workspace:FindFirstChild(ZOMBIE_FOLDER_NAME)
  1386. if not folder then
  1387. for zombie, _ in pairs(espObjects) do
  1388. cleanupESPFor(zombie)
  1389. end
  1390. else
  1391. if not ESP_ENABLED then
  1392. for _, obj in pairs(espObjects) do
  1393. if obj.highlight then obj.highlight.Enabled = false end
  1394. if obj.billboard then obj.billboard.Enabled = false end
  1395. end
  1396. else
  1397. for _, zombie in ipairs(folder:GetChildren()) do
  1398. local hum = zombie:FindFirstChildOfClass("Humanoid")
  1399. local part = getAimPart(zombie)
  1400.  
  1401. if part and hum and hum.Health > 0 then
  1402. local dist = (camera.CFrame.Position - part.Position).Magnitude
  1403. local zType = getZombieType(zombie)
  1404. local col = getTypeColor(zType)
  1405.  
  1406. if dist <= ESP_RANGE then
  1407. local obj = ensureESPFor(zombie)
  1408. if obj then
  1409. local newPart = getAimPart(zombie)
  1410. if newPart and obj.billboard.Adornee ~= newPart then
  1411. obj.billboard.Adornee = newPart
  1412. end
  1413.  
  1414. obj.highlight.Enabled = true
  1415. obj.highlight.OutlineColor = col
  1416. obj.highlight.FillColor = ESP_FILL_COLOR
  1417. obj.highlight.FillTransparency = ESP_FILL_TRANSPARENCY
  1418.  
  1419. local showLabel = ESP_SHOW_LABELS and (dist <= ESP_LABEL_RANGE)
  1420. obj.billboard.Enabled = showLabel
  1421.  
  1422. if showLabel then
  1423. obj.label.TextSize = ESP_LABEL_TEXTSIZE
  1424. obj.label.TextColor3 = col
  1425.  
  1426. local extraY = math.clamp(dist / 220, 0, 2.2)
  1427. obj.billboard.StudsOffset = Vector3.new(0, 2.8 + extraY, 0)
  1428.  
  1429. local tag = ""
  1430. if zType == "BOSS" then
  1431. tag = "BOSS "
  1432. elseif zType == "SPECIAL" then
  1433. tag = "SPECIAL "
  1434. end
  1435.  
  1436. obj.label.Text = tag .. getDisplayName(zombie) .. " [" .. tostring(math.floor(dist)) .. "m]"
  1437. end
  1438. end
  1439. else
  1440. local obj = espObjects[zombie]
  1441. if obj then
  1442. if obj.highlight then obj.highlight.Enabled = false end
  1443. if obj.billboard then obj.billboard.Enabled = false end
  1444. end
  1445. end
  1446. else
  1447. local obj = espObjects[zombie]
  1448. if obj then
  1449. if obj.highlight then obj.highlight.Enabled = false end
  1450. if obj.billboard then obj.billboard.Enabled = false end
  1451. end
  1452. end
  1453. end
  1454. end
  1455. end
  1456.  
  1457.  
  1458. if AIM_ENABLED and DOT_ENABLED then
  1459. local t = CURRENT_TARGET
  1460. if t then
  1461. local adornee = t
  1462. local dotObj = ensureDotForPart(adornee)
  1463. if dotObj then
  1464.  
  1465. for part, d in pairs(dotObjects) do
  1466. if part ~= adornee and d and d.billboard and d.billboard.Enabled then
  1467. despawnDotForPart(part)
  1468. end
  1469. end
  1470. updateDotForPart(adornee)
  1471. end
  1472. else
  1473. for part, d in pairs(dotObjects) do
  1474. if d and d.billboard and d.billboard.Enabled then
  1475. despawnDotForPart(part)
  1476. end
  1477. end
  1478. end
  1479. else
  1480. for part, d in pairs(dotObjects) do
  1481. if d and d.billboard and d.billboard.Enabled then
  1482. despawnDotForPart(part)
  1483. end
  1484. end
  1485. end
  1486.  
  1487.  
  1488. if AIM_ENABLED and CURRENT_TARGET then
  1489. local screenPos, onScreen = camera:WorldToViewportPoint(CURRENT_TARGET.Position)
  1490.  
  1491. local shouldShowArrow = (not onScreen) or cachedObstructed
  1492.  
  1493. if shouldShowArrow then
  1494. local center = Vector2.new(camera.ViewportSize.X/2,camera.ViewportSize.Y/2)
  1495. local dir = Vector2.new(screenPos.X,screenPos.Y) - center
  1496. if dir.Magnitude < 1 then dir = Vector2.new(1,0) end
  1497.  
  1498. local edgeDist = math.min(camera.ViewportSize.X, camera.ViewportSize.Y)/2 - 60
  1499. local edgePos = center + dir.Unit * edgeDist
  1500.  
  1501. edgeArrow.Position = UDim2.new(0, edgePos.X, 0, edgePos.Y)
  1502. edgeArrow.Rotation = math.deg(math.atan2(dir.Y, dir.X)) + 90
  1503.  
  1504. local scale = math.clamp(1.6 - (cachedDistance/200), 0.8, 1.6)
  1505. edgeArrow.Size = UDim2.new(0, 40*scale, 0, 40*scale)
  1506.  
  1507. edgeArrow.ImageColor3 = cachedObstructed and Color3.fromRGB(255,120,120) or Color3.new(1,1,1)
  1508.  
  1509. setArrowVisible(true)
  1510. else
  1511. setArrowVisible(false)
  1512. end
  1513.  
  1514. local zombie = CURRENT_TARGET.Parent
  1515. if zombie and getZombieType(zombie) == "BOSS" then
  1516. local look = camera.CFrame.LookVector
  1517. local dirToTarget = (CURRENT_TARGET.Position - camera.CFrame.Position).Unit
  1518. if look:Dot(dirToTarget) < 0 then
  1519. setGlow(true)
  1520. else
  1521. setGlow(false)
  1522. end
  1523. else
  1524. setGlow(false)
  1525. end
  1526.  
  1527. if cachedDistance > 0 and cachedDistance <= ALERT_DISTANCE then
  1528. alertStroke.Color = Color3.fromRGB(255,70,70)
  1529. alertText.Text = "CLOSE - " .. math.floor(cachedDistance) .. "m"
  1530. setAlert(true)
  1531. else
  1532. setAlert(false)
  1533. end
  1534. else
  1535. setArrowVisible(false)
  1536. setGlow(false)
  1537. setAlert(false)
  1538. end
  1539.  
  1540.  
  1541. for zombie, _ in pairs(espObjects) do
  1542. if not zombie:IsDescendantOf(Workspace) then
  1543. cleanupESPFor(zombie)
  1544. end
  1545. end
  1546. for part, _ in pairs(dotObjects) do
  1547. if not part:IsDescendantOf(Workspace) then
  1548. cleanupDotFor(part)
  1549. end
  1550. end
  1551. end)
Advertisement
Add Comment
Please, Sign In to add comment