
Key RequiredUniversal

-- SERVICES
local player = game.Players.LocalPlayer
local runService = game:GetService("RunService")
local userInput = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game.Players
-- CLEANUP OLD GUI
for _, gui in pairs(player.PlayerGui:GetChildren()) do
if gui.Name == "PvPMenuGui" then
gui:Destroy()
end
end
-- TOGGLES
local menuOpen = false
local namesEnabled = false
local espEnabled = false
local healthEnabled = false
local MAX_DISTANCE = 150
-- GUI
local gui = Instance.new("ScreenGui")
gui.Name = "PvPMenuGui"
gui.ResetOnSpawn = false
gui.Parent = player.PlayerGui
gui.Enabled = true
local menuFrame = Instance.new("Frame")
menuFrame.Size = UDim2.new(0, 300, 0, 450)
menuFrame.Position = UDim2.new(1, 0, 0, -400)
menuFrame.AnchorPoint = Vector2.new(1, 0)
menuFrame.BackgroundColor3 = Color3.fromRGB(20, 20, 20)
menuFrame.BackgroundTransparency = 0.1
menuFrame.BorderSizePixel = 0
menuFrame.Parent = gui
local corner = Instance.new("UICorner")
corner.CornerRadius = UDim.new(0, 10)
corner.Parent = menuFrame
local scroll = Instance.new("ScrollingFrame")
scroll.Size = UDim2.new(1, -20, 1, -20)
scroll.Position = UDim2.new(0, 10, 0, 10)
scroll.BackgroundTransparency = 1
scroll.BorderSizePixel = 0
scroll.CanvasSize = UDim2.new(0,0,0,0)
scroll.ScrollBarThickness = 6
scroll.Parent = menuFrame
local uiList = Instance.new("UIListLayout")
uiList.SortOrder = Enum.SortOrder.LayoutOrder
uiList.Padding = UDim.new(0,5)
uiList.Parent = scroll
-- TITLE
local titleLabel = Instance.new("TextLabel")
titleLabel.Size = UDim2.new(1,0,0,40)
titleLabel.BackgroundTransparency = 1
titleLabel.Text = "XizHub ESP Universal"
titleLabel.TextScaled = true
titleLabel.TextColor3 = Color3.fromRGB(255,255,255)
titleLabel.Parent = scroll
-- BUTTON HELPER
local function makeButton(text)
local btn = Instance.new("TextButton")
btn.Size = UDim2.new(1,0,0,40)
btn.Text = text
btn.TextScaled = true
btn.BackgroundColor3 = Color3.fromRGB(50,50,50)
btn.TextColor3 = Color3.fromRGB(255,255,255)
btn.Parent = scroll
return btn
end
local function updateButtonColor(button, state)
if state then
button.BackgroundColor3 = Color3.fromRGB(200,200,200)
else
button.BackgroundColor3 = Color3.fromRGB(50,50,50)
end
end
-- NAMES BUTTON
local namesButton = makeButton("NAMES")
namesButton.MouseButton1Click:Connect(function()
namesEnabled = not namesEnabled
updateButtonColor(namesButton, namesEnabled)
end)
-- ESP BUTTON
local espButton = makeButton("ESP")
espButton.MouseButton1Click:Connect(function()
espEnabled = not espEnabled
updateButtonColor(espButton, espEnabled)
end)
-- HEALTH BUTTON
local healthButton = makeButton("HEALTH ESP")
healthButton.MouseButton1Click:Connect(function()
healthEnabled = not healthEnabled
updateButtonColor(healthButton, healthEnabled)
end)
-- DISTANCE SLIDER
local distanceLabel = Instance.new("TextLabel")
distanceLabel.Size = UDim2.new(1,0,0,30)
distanceLabel.BackgroundTransparency = 1
distanceLabel.Text = "ESP Distance: "..MAX_DISTANCE
distanceLabel.TextScaled = true
distanceLabel.TextColor3 = Color3.fromRGB(255,255,255)
distanceLabel.Parent = scroll
local distanceSlider = Instance.new("TextBox")
distanceSlider.Size = UDim2.new(1,0,0,30)
distanceSlider.Text = tostring(MAX_DISTANCE)
distanceSlider.TextScaled = true
distanceSlider.ClearTextOnFocus = false
distanceSlider.BackgroundColor3 = Color3.fromRGB(50,50,50)
distanceSlider.TextColor3 = Color3.fromRGB(255,255,255)
distanceSlider.Parent = scroll
distanceSlider.FocusLost:Connect(function()
local val = tonumber(distanceSlider.Text)
if val then
MAX_DISTANCE = val
distanceLabel.Text = "ESP Distance: "..MAX_DISTANCE
end
end)
uiList:GetPropertyChangedSignal("AbsoluteContentSize"):Connect(function()
scroll.CanvasSize = UDim2.new(0,0,0,uiList.AbsoluteContentSize.Y)
end)
-- DISPLAY NAMES
local displayLabels = {}
runService.RenderStepped:Connect(function()
for _, plr in pairs(players:GetPlayers()) do
if plr ~= player then
local c = plr.Character
if c and namesEnabled then
local rootPart = c:FindFirstChild("HumanoidRootPart")
if rootPart then
local playerRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
local dist = playerRoot and (rootPart.Position - playerRoot.Position).Magnitude or 0
if dist <= MAX_DISTANCE then
if not displayLabels[plr] then
local label = Instance.new("BillboardGui")
label.Adornee = rootPart
label.Size = UDim2.new(0,100,0,30)
label.StudsOffset = Vector3.new(0,3,0)
label.AlwaysOnTop = true
label.Parent = player.PlayerGui
local txt = Instance.new("TextLabel")
txt.Size = UDim2.new(1,0,1,0)
txt.BackgroundTransparency = 1
txt.Text = plr.DisplayName
txt.TextScaled = true
txt.TextColor3 = Color3.fromRGB(255,255,255)
txt.Parent = label
displayLabels[plr] = label
end
else
if displayLabels[plr] then
displayLabels[plr]:Destroy()
displayLabels[plr] = nil
end
end
end
elseif displayLabels[plr] then
displayLabels[plr]:Destroy()
displayLabels[plr] = nil
end
end
end
end)
-- ESP + HEALTH ESP
local highlights = {}
runService.Heartbeat:Connect(function()
for _, plr in pairs(players:GetPlayers()) do
if plr ~= player then
local c = plr.Character
if c then
local rootPart = c:FindFirstChild("HumanoidRootPart")
local playerRoot = player.Character and player.Character:FindFirstChild("HumanoidRootPart")
if rootPart and playerRoot then
local dist = (rootPart.Position - playerRoot.Position).Magnitude
local highlight = highlights[plr]
if not highlight and espEnabled then
highlight = Instance.new("Highlight")
highlight.FillTransparency = 1
highlight.OutlineColor = Color3.fromRGB(255,255,255)
highlight.Parent = c
highlights[plr] = highlight
end
if highlight then
highlight.Enabled = espEnabled and dist <= MAX_DISTANCE
if healthEnabled and highlight.Enabled then
local hum = c:FindFirstChildWhichIsA("Humanoid")
if hum then
local hp = math.clamp(hum.Health / hum.MaxHealth, 0, 1)
if hp > 0.8 then
highlight.OutlineColor = Color3.fromRGB(0,255,0)
elseif hp > 0.5 then
highlight.OutlineColor = Color3.fromRGB(255,255,0)
else
highlight.OutlineColor = Color3.fromRGB(255,0,0)
end
end
elseif highlight.Enabled then
highlight.OutlineColor = Color3.fromRGB(255,255,255)
end
end
end
end
end
end
end)
-- TOGGLE MENU
userInput.InputBegan:Connect(function(input, gpe)
if gpe then return end
if input.KeyCode == Enum.KeyCode.RightShift then
menuOpen = not menuOpen
local targetPos
if menuOpen then
targetPos = UDim2.new(1, -10, 0, 50)
else
targetPos = UDim2.new(1, 0, 0, -400)
end
tweenService:Create(menuFrame, TweenInfo.new(0.5, Enum.EasingStyle.Bounce, Enum.EasingDirection.Out), {Position = targetPos}):Play()
end
end)
-- CLEANUP ON PLAYER LEAVE
players.PlayerRemoving:Connect(function(plr)
if displayLabels[plr] then
displayLabels[plr]:Destroy()
displayLabels[plr] = nil
end
if highlights[plr] then
highlights[plr]:Destroy()
highlights[plr] = nil
end
end)No comments yet for this script.



