-- Script Name: Remake NPC hitbox by McTeaMick local Players = game:GetService("Players") local RunService = game:GetService("RunService") local HttpService = game:GetService("HttpService") local CoreGui = game:GetService("CoreGui") local function getUiParent() if type(gethui) == "function" then local ok, hui = pcall(gethui) if ok and typeof(hui) == "Instance" then return hui end end if pcall(function() return CoreGui.Name end) then return CoreGui end local lp = Players.LocalPlayer return lp and lp:FindFirstChild("PlayerGui") end local parent = getUiParent() if not parent then warn("No valid GUI parent found") return end local GUI_NAME = "NPC_HeadBox_Pro" if parent:FindFirstChild(GUI_NAME) then parent[GUI_NAME]:Destroy() end local ScreenGui = Instance.new("ScreenGui") ScreenGui.Name = GUI_NAME ScreenGui.ResetOnSpawn = false ScreenGui.Parent = parent local POPUP_SAVE_FILE = "Remake_NPC_hitbox_by_McTeaMick_NoPopup.txt" local SETTINGS_SAVE_FILE = "Remake_NPC_hitbox_by_McTeaMick_Settings.json" local popupHidden = false local function loadPopupPref() if type(isfile) == "function" and type(readfile) == "function" then local ok, exists = pcall(isfile, POPUP_SAVE_FILE) if ok and exists then local rOk, content = pcall(readfile, POPUP_SAVE_FILE) if rOk and tostring(content):match("^%s*1%s*$") then return true end end end if type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" and env._McTeaMickNpcPopupHidden == true then return true end end return false end local function savePopupPref(hidden) popupHidden = hidden if type(getgenv) == "function" then pcall(function() getgenv()._McTeaMickNpcPopupHidden = hidden end) end if type(writefile) == "function" then pcall(function() writefile(POPUP_SAVE_FILE, hidden and "1" or "0") end) end end popupHidden = loadPopupPref() local BASE_W, BASE_H = 220, 412 local BASE_LIST_W, BASE_LIST_H = 180, 200 local BASE_PANEL_W, BASE_PANEL_H = 180, 185 local accentPresets = { { name = "Crimson", color = Color3.fromRGB(255, 0, 50) }, { name = "Cyan", color = Color3.fromRGB(0, 200, 255) }, { name = "Violet", color = Color3.fromRGB(145, 70, 255) }, { name = "Amber", color = Color3.fromRGB(255, 165, 0) }, } local bgPresets = { { name = "Dark", bg = Color3.fromRGB(20, 20, 25), btn = Color3.fromRGB(40, 40, 45) }, { name = "Midnight", bg = Color3.fromRGB(10, 16, 28), btn = Color3.fromRGB(24, 34, 54) }, { name = "Graphite", bg = Color3.fromRGB(32, 32, 36), btn = Color3.fromRGB(54, 54, 60) }, } local transparencySteps = { 0, 0.15, 0.3, 0.45 } local cornerSteps = { 4, 8, 12, 16 } local guiSizeSteps = { 0.70, 0.85, 1.00, 1.15 } local accentIdx = 1 local bgIdx = 1 local transIdx = 1 local cornerIdx = 2 local guiSizeIdx = 2 local headSize = 12 local hitboxEnabled = false local autoHitboxEnabled = true local hitboxPartMode = "Head" local hitboxApplyMode = "ALL" local selectedNpcLabel = nil local npcList = {} local espEnabled = false local healthEspEnabled = false local nameEspEnabled = false local distEspEnabled = false local espColorMode = "PART" -- "PART" or "HP" local originalParts = {} local uiTheme = { Accent = accentPresets[accentIdx].color, Background = bgPresets[bgIdx].bg, ButtonOff = bgPresets[bgIdx].btn, Text = Color3.new(1, 1, 1), Transparency = transparencySteps[transIdx], CornerPx = cornerSteps[cornerIdx], GuiScale = guiSizeSteps[guiSizeIdx], } local function loadSavedSettings() local raw = nil if type(isfile) == "function" and type(readfile) == "function" then local ok, exists = pcall(isfile, SETTINGS_SAVE_FILE) if ok and exists then local rOk, content = pcall(readfile, SETTINGS_SAVE_FILE) if rOk and type(content) == "string" and content ~= "" then raw = content end end end if not raw and type(getgenv) == "function" then local ok, env = pcall(getgenv) if ok and type(env) == "table" and type(env._McTeaMickNpcSettingsJson) == "string" then raw = env._McTeaMickNpcSettingsJson end end if not raw then return end local dOk, data = pcall(function() return HttpService:JSONDecode(raw) end) if not dOk or type(data) ~= "table" then return end if type(data.headSize) == "number" then headSize = math.clamp(math.round(data.headSize), 1, 100) end if type(data.hitboxEnabled) == "boolean" then hitboxEnabled = data.hitboxEnabled end if type(data.autoHitboxEnabled) == "boolean" then autoHitboxEnabled = data.autoHitboxEnabled end if data.hitboxPartMode == "Head" or data.hitboxPartMode == "Torso" then hitboxPartMode = data.hitboxPartMode end if data.hitboxApplyMode == "ALL" or data.hitboxApplyMode == "ONE" then hitboxApplyMode = data.hitboxApplyMode end if type(data.selectedNpcLabel) == "string" and data.selectedNpcLabel ~= "" then selectedNpcLabel = data.selectedNpcLabel end if type(data.espEnabled) == "boolean" then espEnabled = data.espEnabled end if type(data.healthEspEnabled) == "boolean" then healthEspEnabled = data.healthEspEnabled end if type(data.nameEspEnabled) == "boolean" then nameEspEnabled = data.nameEspEnabled end if type(data.distEspEnabled) == "boolean" then distEspEnabled = data.distEspEnabled end if data.espColorMode == "PART" or data.espColorMode == "HP" then espColorMode = data.espColorMode end if type(data.accentIdx) == "number" and accentPresets[data.accentIdx] then accentIdx = data.accentIdx end if type(data.bgIdx) == "number" and bgPresets[data.bgIdx] then bgIdx = data.bgIdx end if type(data.transIdx) == "number" and transparencySteps[data.transIdx] ~= nil then transIdx = data.transIdx end if type(data.cornerIdx) == "number" and cornerSteps[data.cornerIdx] ~= nil then cornerIdx = data.cornerIdx end if type(data.guiSizeIdx) == "number" and guiSizeSteps[data.guiSizeIdx] ~= nil then guiSizeIdx = data.guiSizeIdx end uiTheme.Accent = accentPresets[accentIdx].color uiTheme.Background = bgPresets[bgIdx].bg uiTheme.ButtonOff = bgPresets[bgIdx].btn uiTheme.Transparency = transparencySteps[transIdx] uiTheme.CornerPx = cornerSteps[cornerIdx] uiTheme.GuiScale = guiSizeSteps[guiSizeIdx] end local function autoSaveSettings() local payload = { headSize = headSize, hitboxEnabled = hitboxEnabled, autoHitboxEnabled = autoHitboxEnabled, hitboxPartMode = hitboxPartMode, hitboxApplyMode = hitboxApplyMode, selectedNpcLabel = selectedNpcLabel or "", espEnabled = espEnabled, healthEspEnabled = healthEspEnabled, nameEspEnabled = nameEspEnabled, distEspEnabled = distEspEnabled, espColorMode = espColorMode, accentIdx = accentIdx, bgIdx = bgIdx, transIdx = transIdx, cornerIdx = cornerIdx, guiSizeIdx = guiSizeIdx, } local eOk, encoded = pcall(function() return HttpService:JSONEncode(payload) end) if not eOk or type(encoded) ~= "string" then return end if type(getgenv) == "function" then pcall(function() getgenv()._McTeaMickNpcSettingsJson = encoded end) end if type(writefile) == "function" then pcall(function() writefile(SETTINGS_SAVE_FILE, encoded) end) end end loadSavedSettings() local MainFrame = Instance.new("Frame") MainFrame.Name = "MainFrame" MainFrame.Size = UDim2.fromOffset(BASE_W, BASE_H) MainFrame.Position = UDim2.fromScale(0.32, 0.08) MainFrame.BackgroundColor3 = uiTheme.Background MainFrame.Active = true MainFrame.Draggable = true MainFrame.Parent = ScreenGui local mainCorner = Instance.new("UICorner") mainCorner.CornerRadius = UDim.new(0, 10) mainCorner.Parent = MainFrame local frameStroke = Instance.new("UIStroke") frameStroke.Color = uiTheme.Accent frameStroke.Thickness = 1.5 frameStroke.Parent = MainFrame local Title = Instance.new("TextLabel") Title.Name = "Title" Title.Size = UDim2.new(1, 0, 0, 28) Title.BackgroundColor3 = uiTheme.Accent Title.TextColor3 = uiTheme.Text Title.Font = Enum.Font.GothamBold Title.TextSize = 11 Title.TextTruncate = Enum.TextTruncate.AtEnd Title.Text = "Remake NPC hitbox by McTeaMick" Title.Parent = MainFrame local titleCorner = Instance.new("UICorner") titleCorner.CornerRadius = UDim.new(0, 10) titleCorner.Parent = Title local function styleBtn(btn, text, pos, size, bg, isAccent) btn.Text = text btn.Position = pos btn.Size = size or UDim2.new(0.86, 0, 0, 21) btn.BackgroundColor3 = bg or uiTheme.ButtonOff btn.TextColor3 = uiTheme.Text btn.Font = Enum.Font.GothamSemibold btn.TextSize = 10 btn.AutoButtonColor = true btn.Parent = MainFrame btn:SetAttribute("IsAccent", isAccent == true) local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, 6) c.Parent = btn return c end local HitboxBtn = Instance.new("TextButton") local AutoHitboxBtn = Instance.new("TextButton") local PartModeBtn = Instance.new("TextButton") local ApplyModeBtn = Instance.new("TextButton") local OpenListBtn = Instance.new("TextButton") local EspBtn = Instance.new("TextButton") local HealthBtn = Instance.new("TextButton") local NameEspBtn = Instance.new("TextButton") local DistEspBtn = Instance.new("TextButton") local EspColorModeBtn = Instance.new("TextButton") local ThemeMenuBtn = Instance.new("TextButton") local DecreaseBtn = Instance.new("TextButton") local IncreaseBtn = Instance.new("TextButton") local SizeLabel = Instance.new("TextLabel") styleBtn(HitboxBtn, hitboxEnabled and "HITBOX: ACTIVE" or "HITBOX: DEACTIVATED", UDim2.new(0.07, 0, 0.085, 0)) styleBtn(AutoHitboxBtn, autoHitboxEnabled and "AUTO HITBOX: ON" or "AUTO HITBOX: OFF", UDim2.new(0.07, 0, 0.142, 0), nil, Color3.fromRGB(0, 180, 100), false) styleBtn(PartModeBtn, "HITBOX PART: " .. string.upper(hitboxPartMode), UDim2.new(0.07, 0, 0.199, 0), nil, Color3.fromRGB(50, 45, 65), false) styleBtn(ApplyModeBtn, hitboxApplyMode == "ALL" and "APPLY TO: ALL NPC" or "APPLY TO: ONE NPC", UDim2.new(0.07, 0, 0.256, 0), nil, Color3.fromRGB(50, 45, 65), false) styleBtn(OpenListBtn, "NPC: ALL NPCs", UDim2.new(0.07, 0, 0.313, 0), nil, Color3.fromRGB(45, 50, 65), false) styleBtn(EspBtn, espEnabled and "NPC ESP: ON" or "NPC ESP: OFF", UDim2.new(0.07, 0, 0.370, 0)) styleBtn(HealthBtn, healthEspEnabled and "HEALTH ESP: ON" or "HEALTH ESP: OFF", UDim2.new(0.07, 0, 0.427, 0)) styleBtn(NameEspBtn, nameEspEnabled and "NAME ESP: ON" or "NAME ESP: OFF", UDim2.new(0.07, 0, 0.484, 0)) styleBtn(DistEspBtn, distEspEnabled and "DIST ESP: ON" or "DIST ESP: OFF", UDim2.new(0.07, 0, 0.541, 0)) styleBtn(EspColorModeBtn, "ESP COLOR: " .. espColorMode, UDim2.new(0.07, 0, 0.598, 0), nil, Color3.fromRGB(55, 50, 75), false) styleBtn(ThemeMenuBtn, "UI THEME: MENU", UDim2.new(0.07, 0, 0.655, 0), nil, Color3.fromRGB(55, 55, 70), false) styleBtn(DecreaseBtn, "-", UDim2.new(0.14, 0, 0.882, 0), UDim2.fromOffset(40, 28), uiTheme.Accent, true) styleBtn(IncreaseBtn, "+", UDim2.new(0.68, 0, 0.882, 0), UDim2.fromOffset(40, 28), Color3.fromRGB(0, 180, 100), false) SizeLabel.Name = "SizeLabel" SizeLabel.Text = "SIZE: " .. headSize SizeLabel.Position = UDim2.new(0, 0, 0.815, 0) SizeLabel.Size = UDim2.new(1, 0, 0, 18) SizeLabel.TextColor3 = uiTheme.Text SizeLabel.Font = Enum.Font.GothamBold SizeLabel.TextSize = 11 SizeLabel.BackgroundTransparency = 1 SizeLabel.Parent = MainFrame -- Scrollable NPC Name Picker List local NpcListFrame = Instance.new("Frame") NpcListFrame.Name = "NpcListFrame" NpcListFrame.Size = UDim2.fromOffset(BASE_LIST_W, BASE_LIST_H) NpcListFrame.Position = UDim2.new(1, 6, 0, 0) NpcListFrame.BackgroundColor3 = uiTheme.Background NpcListFrame.Visible = false NpcListFrame.Parent = MainFrame local npcListCorner = Instance.new("UICorner") npcListCorner.CornerRadius = UDim.new(0, 10) npcListCorner.Parent = NpcListFrame local listStroke = Instance.new("UIStroke") listStroke.Color = uiTheme.Accent listStroke.Thickness = 1.5 listStroke.Parent = NpcListFrame local ListTitle = Instance.new("TextLabel") ListTitle.Size = UDim2.new(1, 0, 0, 26) ListTitle.BackgroundColor3 = Color3.fromRGB(35, 35, 45) ListTitle.TextColor3 = uiTheme.Text ListTitle.Font = Enum.Font.GothamBold ListTitle.TextSize = 10 ListTitle.Text = "SELECT NPC" ListTitle.Parent = NpcListFrame local listTitleCorner = Instance.new("UICorner") listTitleCorner.CornerRadius = UDim.new(0, 10) listTitleCorner.Parent = ListTitle local ScrollList = Instance.new("ScrollingFrame") ScrollList.Name = "ScrollList" ScrollList.Size = UDim2.new(1, -8, 1, -32) ScrollList.Position = UDim2.new(0, 4, 0, 28) ScrollList.BackgroundTransparency = 1 ScrollList.ScrollBarThickness = 4 ScrollList.CanvasSize = UDim2.new(0, 0, 0, 0) ScrollList.Parent = NpcListFrame local layout = Instance.new("UIListLayout") layout.Padding = UDim.new(0, 4) layout.SortOrder = Enum.SortOrder.LayoutOrder layout.Parent = ScrollList -- Custom UI Changer + GUI Size Drawer local ThemePanel = Instance.new("Frame") ThemePanel.Name = "ThemePanel" ThemePanel.Size = UDim2.fromOffset(BASE_PANEL_W, BASE_PANEL_H) ThemePanel.Position = UDim2.new(1, 6, 0, 206) ThemePanel.BackgroundColor3 = uiTheme.Background ThemePanel.BackgroundTransparency = uiTheme.Transparency ThemePanel.Visible = false ThemePanel.Parent = MainFrame local panelCorner = Instance.new("UICorner") panelCorner.CornerRadius = UDim.new(0, 10) panelCorner.Parent = ThemePanel local panelStroke = Instance.new("UIStroke") panelStroke.Color = uiTheme.Accent panelStroke.Thickness = 1.5 panelStroke.Parent = ThemePanel local function makePanelBtn(text, yPos) local b = Instance.new("TextButton") b.Size = UDim2.new(0.88, 0, 0, 26) b.Position = UDim2.new(0.06, 0, 0, yPos) b.BackgroundColor3 = uiTheme.ButtonOff b.TextColor3 = uiTheme.Text b.Font = Enum.Font.GothamSemibold b.TextSize = 10 b.Text = text b.Parent = ThemePanel local c = Instance.new("UICorner") c.CornerRadius = UDim.new(0, 6) c.Parent = b return b end local AccentCycleBtn = makePanelBtn("ACCENT: " .. accentPresets[accentIdx].name, 10) local BgCycleBtn = makePanelBtn("BG: " .. bgPresets[bgIdx].name, 43) local TransCycleBtn = makePanelBtn(string.format("ALPHA: %d%%", math.round(uiTheme.Transparency * 100)), 76) local CornerCycleBtn = makePanelBtn(string.format("RADIUS: %dpx", uiTheme.CornerPx), 109) local GuiSizeCycleBtn = makePanelBtn(string.format("GUI SIZE: %.2fx", uiTheme.GuiScale), 142) -- Small First-Time Info Popup local PopupFrame = Instance.new("Frame") PopupFrame.Name = "IntroPopup" PopupFrame.Size = UDim2.fromOffset(252, 186) PopupFrame.Position = UDim2.fromScale(0.5, 0.5) PopupFrame.AnchorPoint = Vector2.new(0.5, 0.5) PopupFrame.BackgroundColor3 = Color3.fromRGB(22, 22, 28) PopupFrame.Active = true PopupFrame.Draggable = true PopupFrame.Visible = not popupHidden PopupFrame.ZIndex = 20 PopupFrame.Parent = ScreenGui Instance.new("UICorner", PopupFrame).CornerRadius = UDim.new(0, 10) local popupStroke = Instance.new("UIStroke") popupStroke.Color = uiTheme.Accent popupStroke.Thickness = 1.5 popupStroke.Parent = PopupFrame local PopupTitle = Instance.new("TextLabel") PopupTitle.Size = UDim2.new(1, 0, 0, 26) PopupTitle.BackgroundColor3 = uiTheme.Accent PopupTitle.TextColor3 = Color3.new(1, 1, 1) PopupTitle.Font = Enum.Font.GothamBold PopupTitle.TextSize = 11 PopupTitle.Text = "INFO" PopupTitle.ZIndex = 21 PopupTitle.Parent = PopupFrame Instance.new("UICorner", PopupTitle).CornerRadius = UDim.new(0, 10) local PopupMsg = Instance.new("TextLabel") PopupMsg.Size = UDim2.new(1, -16, 0, 102) PopupMsg.Position = UDim2.new(0, 8, 0, 30) PopupMsg.BackgroundTransparency = 1 PopupMsg.TextColor3 = Color3.new(1, 1, 1) PopupMsg.Font = Enum.Font.GothamSemibold PopupMsg.TextSize = 10 PopupMsg.TextWrapped = true PopupMsg.Text = "the original script name is NPC hitbox the best script if you truly wan to try the original.. though it really did not got patch, try find in Scriptblox.\n\nThis script is made with ai, and remake* by McTeaMick on Scriptblox\nOriginal / inspired script by inf6 on Scriptblox" PopupMsg.ZIndex = 21 PopupMsg.Parent = PopupFrame local DontShowBtn = Instance.new("TextButton") DontShowBtn.Size = UDim2.new(0.62, 0, 0, 26) DontShowBtn.Position = UDim2.new(0.05, 0, 1, -34) DontShowBtn.BackgroundColor3 = Color3.fromRGB(45, 45, 55) DontShowBtn.TextColor3 = Color3.new(1, 1, 1) DontShowBtn.Font = Enum.Font.GothamSemibold DontShowBtn.TextSize = 9 DontShowBtn.Text = "DON'T SHOW ME THIS POP UP" DontShowBtn.ZIndex = 21 DontShowBtn.Parent = PopupFrame Instance.new("UICorner", DontShowBtn).CornerRadius = UDim.new(0, 6) local ClosePopupBtn = Instance.new("TextButton") ClosePopupBtn.Size = UDim2.new(0.24, 0, 0, 26) ClosePopupBtn.Position = UDim2.new(0.71, 0, 1, -34) ClosePopupBtn.BackgroundColor3 = Color3.fromRGB(0, 180, 100) ClosePopupBtn.TextColor3 = Color3.new(1, 1, 1) ClosePopupBtn.Font = Enum.Font.GothamBold ClosePopupBtn.TextSize = 10 ClosePopupBtn.Text = "OK" ClosePopupBtn.ZIndex = 21 ClosePopupBtn.Parent = PopupFrame Instance.new("UICorner", ClosePopupBtn).CornerRadius = UDim.new(0, 6) DontShowBtn.MouseButton1Click:Connect(function() savePopupPref(true) PopupFrame.Visible = false end) ClosePopupBtn.MouseButton1Click:Connect(function() PopupFrame.Visible = false end) local HideBtn = Instance.new("TextButton") HideBtn.Name = "ToggleButton" HideBtn.Text = "6" HideBtn.Size = UDim2.fromOffset(40, 40) HideBtn.Position = UDim2.new(0.03, 0, 0.35, 0) HideBtn.BackgroundColor3 = uiTheme.Accent HideBtn.TextColor3 = uiTheme.Text HideBtn.Font = Enum.Font.GothamBold HideBtn.TextSize = 15 HideBtn.Active = true HideBtn.Draggable = true HideBtn.Parent = ScreenGui Instance.new("UICorner", HideBtn).CornerRadius = UDim.new(1, 0) local hideStroke = Instance.new("UIStroke") hideStroke.Thickness = 2 hideStroke.Parent = HideBtn local function applyThemeToAll() local s = uiTheme.GuiScale MainFrame.Size = UDim2.fromOffset(math.round(BASE_W * s), math.round(BASE_H * s)) NpcListFrame.Size = UDim2.fromOffset(math.round(BASE_LIST_W * s), math.round(BASE_LIST_H * s)) ThemePanel.Size = UDim2.fromOffset(math.round(BASE_PANEL_W * s), math.round(BASE_PANEL_H * s)) ThemePanel.Position = UDim2.new(1, math.round(6 * s), 0, math.round(206 * s)) Title.Size = UDim2.new(1, 0, 0, math.round(28 * s)) Title.TextSize = math.clamp(math.round(11 * s), 8, 17) DecreaseBtn.Size = UDim2.fromOffset(math.round(40 * s), math.round(28 * s)) IncreaseBtn.Size = UDim2.fromOffset(math.round(40 * s), math.round(28 * s)) SizeLabel.TextSize = math.clamp(math.round(11 * s), 8, 17) HideBtn.Size = UDim2.fromOffset(math.round(40 * s), math.round(40 * s)) HideBtn.TextSize = math.clamp(math.round(15 * s), 11, 22) MainFrame.BackgroundColor3 = uiTheme.Background MainFrame.BackgroundTransparency = uiTheme.Transparency ThemePanel.BackgroundColor3 = uiTheme.Background ThemePanel.BackgroundTransparency = uiTheme.Transparency NpcListFrame.BackgroundColor3 = uiTheme.Background NpcListFrame.BackgroundTransparency = uiTheme.Transparency mainCorner.CornerRadius = UDim.new(0, uiTheme.CornerPx) titleCorner.CornerRadius = UDim.new(0, uiTheme.CornerPx) panelCorner.CornerRadius = UDim.new(0, uiTheme.CornerPx) npcListCorner.CornerRadius = UDim.new(0, uiTheme.CornerPx) Title.BackgroundColor3 = uiTheme.Accent Title.TextColor3 = uiTheme.Text frameStroke.Color = uiTheme.Accent panelStroke.Color = uiTheme.Accent listStroke.Color = uiTheme.Accent popupStroke.Color = uiTheme.Accent PopupTitle.BackgroundColor3 = uiTheme.Accent HideBtn.BackgroundColor3 = uiTheme.Accent HideBtn.TextColor3 = uiTheme.Text SizeLabel.TextColor3 = uiTheme.Text for _, desc in ipairs(MainFrame:GetDescendants()) do if desc:IsA("TextButton") then desc.TextSize = math.clamp(math.round(10 * s), 8, 16) if desc ~= IncreaseBtn then local isActive = (desc == HitboxBtn and hitboxEnabled) or (desc == AutoHitboxBtn and autoHitboxEnabled) or (desc == EspBtn and espEnabled) or (desc == HealthBtn and healthEspEnabled) or (desc == NameEspBtn and nameEspEnabled) or (desc == DistEspBtn and distEspEnabled) if isActive then desc.BackgroundColor3 = Color3.fromRGB(0, 180, 100) elseif desc:GetAttribute("IsAccent") then desc.BackgroundColor3 = uiTheme.Accent else desc.BackgroundColor3 = uiTheme.ButtonOff end end desc.TextColor3 = uiTheme.Text elseif desc:IsA("UICorner") and desc ~= mainCorner and desc ~= titleCorner and desc ~= panelCorner and desc ~= npcListCorner then desc.CornerRadius = UDim.new(0, math.min(uiTheme.CornerPx, 8)) end end end local function getNpcDisplayName(model, hum) local attr = model and model:GetAttribute("DisplayName") if type(attr) == "string" and attr ~= "" then return attr end if hum and type(hum.DisplayName) == "string" and hum.DisplayName ~= "" then return hum.DisplayName end return model and model.Name or "NPC" end local function getNpcBodyPartColor(model, head, root) local candidate = nil if model then candidate = model:FindFirstChild("Torso") or model:FindFirstChild("UpperTorso") end if not (candidate and candidate:IsA("BasePart")) then candidate = head end if not (candidate and candidate:IsA("BasePart")) and root and root:IsA("BasePart") then candidate = root end if candidate and candidate:IsA("BasePart") then local col = candidate.Color local maxC = math.max(col.R, col.G, col.B) local minC = math.min(col.R, col.G, col.B) if maxC > 0.14 and not (minC > 0.88 and (maxC - minC) < 0.08) then return col end end return nil end local function getNpcEspColor(model, head, root, ratio) local hpColor = Color3.fromRGB(255, 0, 50):Lerp(Color3.fromRGB(0, 255, 100), ratio) if espColorMode == "PART" then local partColor = getNpcBodyPartColor(model, head, root) if partColor then return partColor end end return hpColor end local function getNpcMinMaxHealth(model, hum) local minHp = 0 local maxHp = hum and tonumber(hum.MaxHealth) or 100 local aMin = model and tonumber(model:GetAttribute("MinHealth")) local aMax = model and tonumber(model:GetAttribute("MaxHealth")) local vMin = model and (model:FindFirstChild("MinHealth") or (hum and hum:FindFirstChild("MinHealth"))) local vMax = model and (model:FindFirstChild("MaxHealth") or (hum and hum:FindFirstChild("MaxHealth"))) if aMin ~= nil then minHp = aMin elseif vMin and (vMin:IsA("NumberValue") or vMin:IsA("IntValue")) then minHp = vMin.Value end if aMax ~= nil then maxHp = aMax elseif vMax and (vMax:IsA("NumberValue") or vMax:IsA("IntValue")) then maxHp = vMax.Value end if not maxHp or maxHp <= minHp then maxHp = minHp + 1 end local attrHp = model and tonumber(model:GetAttribute("Health")) local curHp = attrHp ~= nil and attrHp or (hum and tonumber(hum.Health) or minHp) curHp = math.clamp(curHp, minHp, maxHp) return curHp, minHp, maxHp end local function getReferencePosition() local lp = Players.LocalPlayer local char = lp and lp.Character local root = char and (char:FindFirstChild("HumanoidRootPart") or char:FindFirstChild("Head")) if root and root:IsA("BasePart") then return root.Position end local cam = workspace.CurrentCamera return cam and cam.CFrame.Position or Vector3.zero end local function getHitboxPart(model, head) if hitboxPartMode == "Torso" then local torso = model:FindFirstChild("Torso") or model:FindFirstChild("UpperTorso") if torso and torso:IsA("BasePart") then return torso end end return head end local function restorePart(part) local saved = originalParts[part] if saved and part and part.Parent then pcall(function() part.Size = saved.Size part.Transparency = saved.Transparency part.CanCollide = saved.CanCollide part.Massless = saved.Massless end) end originalParts[part] = nil end local function restoreAllParts() for part in pairs(originalParts) do restorePart(part) end end local function clearAllHighlights() for _, desc in ipairs(workspace:GetDescendants()) do if desc:IsA("Highlight") and desc.Name == "ESP_Highlight" then desc:Destroy() end end end local function clearAllHealthEsp() for _, desc in ipairs(workspace:GetDescendants()) do if desc:IsA("BillboardGui") and desc.Name == "NPC_Health_ESP" then desc:Destroy() end end end local function clearAllInfoEsp() for _, desc in ipairs(workspace:GetDescendants()) do if desc:IsA("BillboardGui") and desc.Name == "NPC_Info_ESP" then desc:Destroy() end end end local function getStableDistScale(studs) return math.clamp(1.30 - (studs / 240), 0.85, 1.30) end local function updateHealthBillboard(model, hum, head, root, refPos) local gui = model:FindFirstChild("NPC_Health_ESP") if not gui then gui = Instance.new("BillboardGui") gui.Name = "NPC_Health_ESP" gui.Adornee = head gui.Size = UDim2.fromOffset(104, 24) gui.StudsOffset = Vector3.new(0, 2.4, 0) gui.AlwaysOnTop = true gui.Parent = model local label = Instance.new("TextLabel") label.Name = "HpLabel" label.Size = UDim2.new(1, 0, 0, 15) label.Position = UDim2.new(0, 0, 0, 0) label.BackgroundTransparency = 1 label.TextColor3 = uiTheme.Text label.TextStrokeTransparency = 1 label.Font = Enum.Font.GothamBold label.TextSize = 12 label.Parent = gui local bg = Instance.new("Frame") bg.Name = "BarBg" bg.Size = UDim2.new(0.76, 0, 0, 5) bg.Position = UDim2.new(0.12, 0, 0.72, 0) bg.BackgroundColor3 = Color3.fromRGB(25, 25, 25) bg.BorderSizePixel = 0 bg.Parent = gui Instance.new("UICorner", bg).CornerRadius = UDim.new(0, 3) local fill = Instance.new("Frame") fill.Name = "BarFill" fill.Size = UDim2.new(1, 0, 1, 0) fill.BackgroundColor3 = Color3.fromRGB(0, 255, 100) fill.BorderSizePixel = 0 fill.Parent = bg Instance.new("UICorner", fill).CornerRadius = UDim.new(0, 3) end local npcPos = root and root.Position or head.Position local studs = (npcPos - refPos).Magnitude local distScale = getStableDistScale(studs) gui.Size = UDim2.fromOffset(math.round(104 * distScale), math.round(24 * distScale)) gui.StudsOffset = Vector3.new(0, 2.4 * distScale, 0) local curHp, minHp, maxHp = getNpcMinMaxHealth(model, hum) local ratio = math.clamp((curHp - minHp) / (maxHp - minHp), 0, 1) local barColor = getNpcEspColor(model, head, root, ratio) local label = gui:FindFirstChild("HpLabel") local bg = gui:FindFirstChild("BarBg") local fill = bg and bg:FindFirstChild("BarFill") if label then label.TextColor3 = uiTheme.Text label.TextStrokeTransparency = 1 label.Size = UDim2.new(1, 0, 0, math.clamp(math.round(15 * distScale), 13, 20)) label.TextSize = math.clamp(math.round(12 * distScale), 12, 16) label.Text = string.format("HP: %d / %d", math.ceil(curHp), math.ceil(maxHp)) end if bg then bg.Size = UDim2.new(0.76, 0, 0, math.clamp(math.round(5 * distScale), 4, 8)) end if fill then fill.Size = UDim2.new(ratio, 0, 1, 0) fill.BackgroundColor3 = barColor end end local function updateNameAndDist(model, hum, head, root, refPos) local gui = model:FindFirstChild("NPC_Info_ESP") if not gui then gui = Instance.new("BillboardGui") gui.Name = "NPC_Info_ESP" gui.Adornee = head gui.Size = UDim2.fromOffset(160, 22) gui.StudsOffset = Vector3.new(0, 4.2, 0) gui.AlwaysOnTop = true gui.Parent = model local lbl = Instance.new("TextLabel") lbl.Name = "InfoLabel" lbl.Size = UDim2.new(1, 0, 1, 0) lbl.BackgroundTransparency = 1 lbl.TextColor3 = uiTheme.Text lbl.TextStrokeTransparency = 1 lbl.Font = Enum.Font.GothamBold lbl.TextSize = 12 lbl.Parent = gui end local npcPos = root and root.Position or head.Position local studs = (npcPos - refPos).Magnitude local distScale = getStableDistScale(studs) gui.Size = UDim2.fromOffset(math.round(160 * distScale), math.round(22 * distScale)) gui.StudsOffset = Vector3.new(0, 4.2 * distScale, 0) local lbl = gui:FindFirstChild("InfoLabel") if not lbl then return end local curHp, minHp, maxHp = getNpcMinMaxHealth(model, hum) local ratio = math.clamp((curHp - minHp) / (maxHp - minHp), 0, 1) local textColor = (espColorMode == "PART") and (getNpcBodyPartColor(model, head, root) or uiTheme.Text) or getNpcEspColor(model, head, root, ratio) lbl.TextColor3 = textColor lbl.TextStrokeTransparency = 1 lbl.Size = UDim2.new(1, 0, 0, math.clamp(math.round(15 * distScale), 13, 20)) lbl.TextSize = math.clamp(math.round(12 * distScale), 12, 16) local npcName = getNpcDisplayName(model, hum) local roundedStuds = math.floor(studs + 0.5) if nameEspEnabled and distEspEnabled then lbl.Text = npcName .. " [" .. tostring(roundedStuds) .. " studs]" elseif nameEspEnabled then lbl.Text = npcName elseif distEspEnabled then lbl.Text = tostring(roundedStuds) .. " studs" else lbl.Text = "" end end local function syncTargetButtonLabel() if hitboxApplyMode == "ALL" then ApplyModeBtn.Text = "APPLY TO: ALL NPC" OpenListBtn.Text = "NPC: ALL NPCs" return end ApplyModeBtn.Text = "APPLY TO: ONE NPC" if selectedNpcLabel then OpenListBtn.Text = "NPC: " .. selectedNpcLabel elseif #npcList > 0 then selectedNpcLabel = npcList[1].label OpenListBtn.Text = "NPC: " .. selectedNpcLabel else OpenListBtn.Text = "NPC: NONE FOUND" end end local function rebuildNpcListButtons() for _, child in ipairs(ScrollList:GetChildren()) do if child:IsA("TextButton") then child:Destroy() end end local allRow = Instance.new("TextButton") allRow.Size = UDim2.new(1, -4, 0, 24) allRow.LayoutOrder = 0 allRow.Font = Enum.Font.GothamBold allRow.TextSize = 10 allRow.Text = "[ALL NPCs]" allRow.BackgroundColor3 = (hitboxApplyMode == "ALL") and Color3.fromRGB(0, 180, 100) or Color3.fromRGB(55, 45, 75) allRow.TextColor3 = uiTheme.Text allRow.Parent = ScrollList Instance.new("UICorner", allRow).CornerRadius = UDim.new(0, 6) allRow.MouseButton1Click:Connect(function() hitboxApplyMode = "ALL" selectedNpcLabel = nil syncTargetButtonLabel() restoreAllParts() rebuildNpcListButtons() autoSaveSettings() NpcListFrame.Visible = false end) for i, item in ipairs(npcList) do local row = Instance.new("TextButton") row.Size = UDim2.new(1, -4, 0, 24) row.LayoutOrder = i row.Font = Enum.Font.GothamSemibold row.TextSize = 10 row.TextTruncate = Enum.TextTruncate.AtEnd row.Text = item.label local isSelected = (hitboxApplyMode == "ONE" and item.label == selectedNpcLabel) row.BackgroundColor3 = isSelected and Color3.fromRGB(0, 180, 100) or Color3.fromRGB(40, 40, 48) row.TextColor3 = uiTheme.Text row.Parent = ScrollList Instance.new("UICorner", row).CornerRadius = UDim.new(0, 6) row.MouseButton1Click:Connect(function() selectedNpcLabel = item.label hitboxApplyMode = "ONE" syncTargetButtonLabel() restoreAllParts() rebuildNpcListButtons() autoSaveSettings() end) end ScrollList.CanvasSize = UDim2.new(0, 0, 0, (#npcList + 1) * 28) end HideBtn.MouseButton1Click:Connect(function() MainFrame.Visible = not MainFrame.Visible end) OpenListBtn.MouseButton1Click:Connect(function() NpcListFrame.Visible = not NpcListFrame.Visible if NpcListFrame.Visible then rebuildNpcListButtons() end end) ThemeMenuBtn.MouseButton1Click:Connect(function() ThemePanel.Visible = not ThemePanel.Visible end) HitboxBtn.MouseButton1Click:Connect(function() hitboxEnabled = not hitboxEnabled HitboxBtn.Text = hitboxEnabled and "HITBOX: ACTIVE" or "HITBOX: DEACTIVATED" HitboxBtn.BackgroundColor3 = hitboxEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff if not hitboxEnabled then restoreAllParts() end autoSaveSettings() end) AutoHitboxBtn.MouseButton1Click:Connect(function() autoHitboxEnabled = not autoHitboxEnabled AutoHitboxBtn.Text = autoHitboxEnabled and "AUTO HITBOX: ON" or "AUTO HITBOX: OFF" AutoHitboxBtn.BackgroundColor3 = autoHitboxEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff autoSaveSettings() end) PartModeBtn.MouseButton1Click:Connect(function() hitboxPartMode = (hitboxPartMode == "Head") and "Torso" or "Head" PartModeBtn.Text = "HITBOX PART: " .. string.upper(hitboxPartMode) restoreAllParts() autoSaveSettings() end) ApplyModeBtn.MouseButton1Click:Connect(function() hitboxApplyMode = (hitboxApplyMode == "ALL") and "ONE" or "ALL" if hitboxApplyMode == "ONE" and not selectedNpcLabel and #npcList > 0 then selectedNpcLabel = npcList[1].label end syncTargetButtonLabel() restoreAllParts() autoSaveSettings() end) EspBtn.MouseButton1Click:Connect(function() espEnabled = not espEnabled EspBtn.Text = espEnabled and "NPC ESP: ON" or "NPC ESP: OFF" EspBtn.BackgroundColor3 = espEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff if not espEnabled then clearAllHighlights() end autoSaveSettings() end) HealthBtn.MouseButton1Click:Connect(function() healthEspEnabled = not healthEspEnabled HealthBtn.Text = healthEspEnabled and "HEALTH ESP: ON" or "HEALTH ESP: OFF" HealthBtn.BackgroundColor3 = healthEspEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff if not healthEspEnabled then clearAllHealthEsp() end autoSaveSettings() end) NameEspBtn.MouseButton1Click:Connect(function() nameEspEnabled = not nameEspEnabled NameEspBtn.Text = nameEspEnabled and "NAME ESP: ON" or "NAME ESP: OFF" NameEspBtn.BackgroundColor3 = nameEspEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff if not nameEspEnabled and not distEspEnabled then clearAllInfoEsp() end autoSaveSettings() end) DistEspBtn.MouseButton1Click:Connect(function() distEspEnabled = not distEspEnabled DistEspBtn.Text = distEspEnabled and "DIST ESP: ON" or "DIST ESP: OFF" DistEspBtn.BackgroundColor3 = distEspEnabled and Color3.fromRGB(0, 180, 100) or uiTheme.ButtonOff if not nameEspEnabled and not distEspEnabled then clearAllInfoEsp() end autoSaveSettings() end) EspColorModeBtn.MouseButton1Click:Connect(function() espColorMode = (espColorMode == "PART") and "HP" or "PART" EspColorModeBtn.Text = "ESP COLOR: " .. espColorMode autoSaveSettings() end) AccentCycleBtn.MouseButton1Click:Connect(function() accentIdx = (accentIdx % #accentPresets) + 1 local preset = accentPresets[accentIdx] uiTheme.Accent = preset.color AccentCycleBtn.Text = "ACCENT: " .. preset.name applyThemeToAll() autoSaveSettings() end) BgCycleBtn.MouseButton1Click:Connect(function() bgIdx = (bgIdx % #bgPresets) + 1 local preset = bgPresets[bgIdx] uiTheme.Background = preset.bg uiTheme.ButtonOff = preset.btn BgCycleBtn.Text = "BG: " .. preset.name applyThemeToAll() autoSaveSettings() end) TransCycleBtn.MouseButton1Click:Connect(function() transIdx = (transIdx % #transparencySteps) + 1 uiTheme.Transparency = transparencySteps[transIdx] TransCycleBtn.Text = string.format("ALPHA: %d%%", math.round(uiTheme.Transparency * 100)) applyThemeToAll() autoSaveSettings() end) CornerCycleBtn.MouseButton1Click:Connect(function() cornerIdx = (cornerIdx % #cornerSteps) + 1 uiTheme.CornerPx = cornerSteps[cornerIdx] CornerCycleBtn.Text = string.format("RADIUS: %dpx", uiTheme.CornerPx) applyThemeToAll() autoSaveSettings() end) GuiSizeCycleBtn.MouseButton1Click:Connect(function() guiSizeIdx = (guiSizeIdx % #guiSizeSteps) + 1 uiTheme.GuiScale = guiSizeSteps[guiSizeIdx] GuiSizeCycleBtn.Text = string.format("GUI SIZE: %.2fx", uiTheme.GuiScale) applyThemeToAll() autoSaveSettings() end) local function updateSize(delta) headSize = math.clamp(headSize + delta, 1, 100) SizeLabel.Text = "SIZE: " .. headSize autoSaveSettings() end IncreaseBtn.MouseButton1Click:Connect(function() updateSize(1) end) DecreaseBtn.MouseButton1Click:Connect(function() updateSize(-1) end) local function getNPCs() local npcs = {} local counts = {} for _, obj in ipairs(workspace:GetDescendants()) do if obj:IsA("Model") and not Players:GetPlayerFromCharacter(obj) then local hum = obj:FindFirstChildOfClass("Humanoid") local head = obj:FindFirstChild("Head") local root = obj:FindFirstChild("HumanoidRootPart") if hum and head and head:IsA("BasePart") and root and root:IsA("BasePart") and not root.Anchored then local baseName = getNpcDisplayName(obj, hum) counts[baseName] = (counts[baseName] or 0) + 1 local label = counts[baseName] > 1 and (baseName .. " #" .. tostring(counts[baseName])) or baseName table.insert(npcs, { model = obj, hum = hum, head = head, root = root, label = label }) end end end return npcs end local elapsed = 0 RunService.Heartbeat:Connect(function(dt) elapsed += dt if elapsed < 0.25 then return end elapsed = 0 local targetSize = Vector3.new(headSize, headSize, headSize) local refPos = getReferencePosition() local npcs = getNPCs() npcList = npcs if hitboxApplyMode == "ONE" and #npcList > 0 then local found = false for _, item in ipairs(npcList) do if item.label == selectedNpcLabel then found = true break end end if not found then selectedNpcLabel = npcList[1].label end end syncTargetButtonLabel() if NpcListFrame.Visible then rebuildNpcListButtons() end local canApply = hitboxEnabled and autoHitboxEnabled local activeParts = {} for _, npc in ipairs(npcs) do local model, hum, head, root = npc.model, npc.hum, npc.head, npc.root local targetPart = getHitboxPart(model, head) local matchesTarget = (hitboxApplyMode == "ALL") or (npc.label == selectedNpcLabel) if canApply and matchesTarget and hum.Health > 0 and targetPart then activeParts[targetPart] = true if not originalParts[targetPart] then originalParts[targetPart] = { Size = targetPart.Size, Transparency = targetPart.Transparency, CanCollide = targetPart.CanCollide, Massless = targetPart.Massless, } end if targetPart.Size ~= targetSize then pcall(function() targetPart.Size = targetSize targetPart.Transparency = 0.6 targetPart.CanCollide = false targetPart.Massless = true end) end end local hl = model:FindFirstChild("ESP_Highlight") if espEnabled then pcall(function() if not hl then hl = Instance.new("Highlight") hl.Name = "ESP_Highlight" hl.OutlineColor = Color3.new(1, 1, 1) hl.Parent = model end hl.FillColor = hum.Health <= 0 and Color3.fromRGB(255, 0, 0) or Color3.fromRGB(0, 255, 0) end) elseif hl then hl:Destroy() end local hpGui = model:FindFirstChild("NPC_Health_ESP") if healthEspEnabled then pcall(function() updateHealthBillboard(model, hum, head, root, refPos) end) elseif hpGui then hpGui:Destroy() end local infoGui = model:FindFirstChild("NPC_Info_ESP") if nameEspEnabled or distEspEnabled then pcall(function() updateNameAndDist(model, hum, head, root, refPos) end) elseif infoGui then infoGui:Destroy() end end for part in pairs(originalParts) do if not activeParts[part] then restorePart(part) end end end) syncTargetButtonLabel() applyThemeToAll()