-- LocalScript inside StarterGui local Players = game:GetService("Players") local TweenService = game:GetService("TweenService") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local Camera = workspace.CurrentCamera -- Wait for UI layers to load safely local playerGui = LocalPlayer:WaitForChild("PlayerGui", 10) if not playerGui then return end ---------------------------------------------------------------- -- 1. GUI CREATION (ZANIX HUB - VIP Expanded Panel) ---------------------------------------------------------------- local screenGui = Instance.new("ScreenGui") screenGui.Name = "ZanixHubPanel" screenGui.ResetOnSpawn = false screenGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling screenGui.Parent = playerGui -- Main Container (Height increased to 212 to perfectly fit the Golden VIP row) local mainFrame = Instance.new("Frame") mainFrame.Size = UDim2.new(0, 260, 0, 212) mainFrame.Position = UDim2.new(0.05, 0, 0.4, 0) mainFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 22) mainFrame.BorderSizePixel = 0 mainFrame.Active = true mainFrame.Draggable = true mainFrame.Parent = screenGui local mainCorner = Instance.new("UICorner") mainCorner.CornerRadius = UDim.new(0, 10) mainCorner.Parent = mainFrame local mainStroke = Instance.new("UIStroke") mainStroke.Color = Color3.fromRGB(45, 45, 50) mainStroke.Thickness = 1.5 mainStroke.ApplyStrokeMode = Enum.ApplyStrokeMode.Border mainStroke.Parent = mainFrame -- Title Banner local titleLabel = Instance.new("TextLabel") titleLabel.Size = UDim2.new(1, 0, 0, 35) titleLabel.Position = UDim2.new(0, 0, 0, 5) titleLabel.BackgroundTransparency = 1 titleLabel.TextColor3 = Color3.fromRGB(240, 240, 245) titleLabel.Text = "ZANIX HUB" titleLabel.Font = Enum.Font.GothamBold titleLabel.TextSize = 14 titleLabel.Parent = mainFrame -- Row 1: Visual Markers local findButton = Instance.new("TextButton") findButton.Size = UDim2.new(0, 110, 0, 42) findButton.Position = UDim2.new(0, 14, 0, 48) findButton.BackgroundColor3 = Color3.fromRGB(32, 34, 40) findButton.TextColor3 = Color3.fromRGB(180, 185, 200) findButton.Text = "Visual Markers" findButton.Font = Enum.Font.GothamMedium findButton.TextSize = 12 findButton.Parent = mainFrame local findCorner = Instance.new("UICorner") findCorner.CornerRadius = UDim.new(0, 8) findCorner.Parent = findButton local findStroke = Instance.new("UIStroke") findStroke.Color = Color3.fromRGB(55, 60, 75) findStroke.Thickness = 1 findStroke.Parent = findButton -- Row 1: Strict Lock local trackButton = Instance.new("TextButton") trackButton.Size = UDim2.new(0, 110, 0, 42) trackButton.Position = UDim2.new(0, 136, 0, 48) trackButton.BackgroundColor3 = Color3.fromRGB(32, 34, 40) trackButton.TextColor3 = Color3.fromRGB(180, 185, 200) trackButton.Text = "Strict Lock" trackButton.Font = Enum.Font.GothamMedium trackButton.TextSize = 12 trackButton.Parent = mainFrame local trackCorner = Instance.new("UICorner") trackCorner.CornerRadius = UDim.new(0, 8) trackCorner.Parent = trackButton local trackStroke = Instance.new("UIStroke") trackStroke.Color = Color3.fromRGB(55, 60, 75) trackStroke.Thickness = 1 trackStroke.Parent = trackButton -- Row 2: Target Mode local headButton = Instance.new("TextButton") headButton.Size = UDim2.new(0, 232, 0, 42) headButton.Position = UDim2.new(0, 14, 0, 102) headButton.BackgroundColor3 = Color3.fromRGB(32, 34, 40) headButton.TextColor3 = Color3.fromRGB(180, 185, 200) headButton.Text = "Target: Torso Mode" headButton.Font = Enum.Font.GothamMedium headButton.TextSize = 12 headButton.Parent = mainFrame local headCorner = Instance.new("UICorner") headCorner.CornerRadius = UDim.new(0, 8) headCorner.Parent = headButton local headStroke = Instance.new("UIStroke") headStroke.Color = Color3.fromRGB(55, 60, 75) headStroke.Thickness = 1 headStroke.Parent = headButton -- Row 3: GOLDEN VIP Anti Hit Button local antiHitButton = Instance.new("TextButton") antiHitButton.Size = UDim2.new(0, 232, 0, 42) antiHitButton.Position = UDim2.new(0, 14, 0, 156) antiHitButton.BackgroundColor3 = Color3.fromRGB(35, 33, 25) antiHitButton.TextColor3 = Color3.fromRGB(212, 175, 55) antiHitButton.Text = "👑 Anti Hit: OFF" antiHitButton.Font = Enum.Font.GothamBold antiHitButton.TextSize = 12 antiHitButton.Parent = mainFrame local antiHitCorner = Instance.new("UICorner") antiHitCorner.CornerRadius = UDim.new(0, 8) antiHitCorner.Parent = antiHitButton local antiHitStroke = Instance.new("UIStroke") antiHitStroke.Color = Color3.fromRGB(160, 130, 40) antiHitStroke.Thickness = 1.5 antiHitStroke.Parent = antiHitButton ---------------------------------------------------------------- -- 2. CORE TARGETING & HIGHLIGHT LOGIC ---------------------------------------------------------------- local activeHighlights = {} local findingActive = false local trackingActive = false local headModeActive = false local antiHitActive = false local currentTargetPart = nil local function getTargetPartName() return headModeActive and "Head" or "HumanoidRootPart" end local function getClosestPlayer() local closestPlayer = nil local shortestDistance = math.huge if LocalPlayer.Character and LocalPlayer.Character:FindFirstChild("HumanoidRootPart") then local localPos = LocalPlayer.Character.HumanoidRootPart.Position for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character and player.Character:FindFirstChild("HumanoidRootPart") then local targetPos = player.Character.HumanoidRootPart.Position local distance = (targetPos - localPos).Magnitude if distance < shortestDistance then shortestDistance = distance closestPlayer = player end end end end return closestPlayer end local function updateCurrentTarget() if trackingActive then local targetPlayer = getClosestPlayer() if targetPlayer and targetPlayer.Character then currentTargetPart = targetPlayer.Character:FindFirstChild(getTargetPartName()) else currentTargetPart = nil end else currentTargetPart = nil end end local function clearHighlights() for _, highlight in ipairs(activeHighlights) do if highlight and highlight.Parent then highlight:Destroy() end end table.clear(activeHighlights) end local function highlightCharacter(character) if not character then return end local existing = character:FindFirstChildOfClass("Highlight") if existing then existing:Destroy() end local highlight = Instance.new("Highlight") highlight.FillColor = Color3.fromRGB(0, 120, 215) highlight.FillTransparency = 0.65 highlight.OutlineColor = Color3.fromRGB(255, 255, 255) highlight.OutlineTransparency = 0.1 highlight.Adornee = character highlight.Parent = character table.insert(activeHighlights, highlight) end local function tweenButtonColor(button, stroke, targetBg, targetText, targetStroke) TweenService:Create(button, TweenInfo.new(0.2), {BackgroundColor3 = targetBg, TextColor3 = targetText}):Play() TweenService:Create(stroke, TweenInfo.new(0.2), {Color = targetStroke}):Play() end ---------------------------------------------------------------- -- 3. AUTOMATIC RESPAWN REFRESH HANDLERS ---------------------------------------------------------------- local function setupPlayerListeners(player) player.CharacterAdded:Connect(function(character) if findingActive and player ~= LocalPlayer then task.wait(0.2) highlightCharacter(character) end end) end for _, player in ipairs(Players:GetPlayers()) do setupPlayerListeners(player) end Players.PlayerAdded:Connect(setupPlayerListeners) LocalPlayer.CharacterAdded:Connect(function() task.wait(0.2) if findingActive then clearHighlights() for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then highlightCharacter(player.Character) end end end end) ---------------------------------------------------------------- -- 4. INTERACTION & EXECUTION LOOPS ---------------------------------------------------------------- -- VISUAL MARKERS TOGGLE findButton.MouseButton1Click:Connect(function() findingActive = not findingActive if findingActive then tweenButtonColor(findButton, findStroke, Color3.fromRGB(0, 120, 215), Color3.fromRGB(255, 255, 255), Color3.fromRGB(100, 180, 255)) findButton.Text = "Clear Markers" for _, player in ipairs(Players:GetPlayers()) do if player ~= LocalPlayer and player.Character then highlightCharacter(player.Character) end end else tweenButtonColor(findButton, findStroke, Color3.fromRGB(32, 34, 40), Color3.fromRGB(180, 185, 200), Color3.fromRGB(55, 60, 75)) findButton.Text = "Visual Markers" clearHighlights() end end) -- STRICT LOCK TOGGLE trackButton.MouseButton1Click:Connect(function() trackingActive = not trackingActive if trackingActive then tweenButtonColor(trackButton, trackStroke, Color3.fromRGB(231, 76, 60), Color3.fromRGB(255, 255, 255), Color3.fromRGB(255, 120, 120)) trackButton.Text = "Lock Active" updateCurrentTarget() else tweenButtonColor(trackButton, trackStroke, Color3.fromRGB(32, 34, 40), Color3.fromRGB(180, 185, 200), Color3.fromRGB(55, 60, 75)) trackButton.Text = "Strict Lock" currentTargetPart = nil Camera.CameraType = Enum.CameraType.Custom end end) -- HEAD MODE TOGGLE headButton.MouseButton1Click:Connect(function() headModeActive = not headModeActive if headModeActive then tweenButtonColor(headButton, headStroke, Color3.fromRGB(142, 68, 173), Color3.fromRGB(255, 255, 255), Color3.fromRGB(190, 120, 220)) headButton.Text = "Target: HEAD MODE" else tweenButtonColor(headButton, headStroke, Color3.fromRGB(32, 34, 40), Color3.fromRGB(180, 185, 200), Color3.fromRGB(55, 60, 75)) headButton.Text = "Target: Torso Mode" end updateCurrentTarget() end) -- GOLDEN VIP: ANTI HIT TOGGLE (Now includes invisibility logic) antiHitButton.MouseButton1Click:Connect(function() antiHitActive = not antiHitActive if antiHitActive then tweenButtonColor(antiHitButton, antiHitStroke, Color3.fromRGB(212, 175, 55), Color3.fromRGB(20, 20, 22), Color3.fromRGB(255, 235, 170)) antiHitButton.Text = "👑 Anti Hit: ACTIVE" else tweenButtonColor(antiHitButton, antiHitStroke, Color3.fromRGB(35, 33, 25), Color3.fromRGB(212, 175, 55), Color3.fromRGB(160, 130, 40)) antiHitButton.Text = "👑 Anti Hit: OFF" end -- INVISIBILITY LOGIC (Safe & Cosmetic) local character = LocalPlayer.Character if character then for _, part in ipairs(character:GetDescendants()) do if part:IsA("BasePart") then if antiHitActive then part.LocalTransparencyModifier = 1 else part.LocalTransparencyModifier = 0 end end end end end) ---------------------------------------------------------------- -- 5. RENDERING RUNTIME ENGINE ---------------------------------------------------------------- -- 5-SECOND DISTANCE REFRESH LOOP task.spawn(function() while true do task.wait(5) updateCurrentTarget() end end) -- ABSOLUTE PRIORITY LOCK ENGINE RunService:BindToRenderStep("FirstPersonCameraLock", Enum.RenderPriority.Last.Value, function() if trackingActive and currentTargetPart then Camera.CameraType = Enum.CameraType.Scriptable local camPos = Camera.CFrame.Position local targetPos = currentTargetPart.Position Camera.CFrame = CFrame.lookAt(camPos, targetPos) elseif trackingActive and not currentTargetPart then Camera.CameraType = Enum.CameraType.Custom end end) -- Clean exit checks Players.PlayerRemoving:Connect(function(player) if player.Character then local visual = player.Character:FindFirstChildOfClass("Highlight") if visual then visual:Destroy() end end end)