Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Players = game:GetService("Players")
- local RunService = game:GetService("RunService")
- local UserInputService = game:GetService("UserInputService")
- local LocalPlayer = Players.LocalPlayer
- local gui = LocalPlayer:WaitForChild("PlayerGui")
- -- Settings
- _G.HeadSize = 15
- _G.HitboxSize = Vector3.new(15, 15, 15)
- _G.Disabled = false
- _G.ToggleKey = Enum.KeyCode.H
- local detectionRange = 25
- local frameUpdateRate = 0.1 -- Reduce lag by updating every 0.1s
- -- GUI Setup
- local frame = Instance.new("Frame")
- frame.Size = UDim2.new(0, 200, 0, 50)
- frame.Position = UDim2.new(0.5, -100, 0.1, 0)
- frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
- frame.BackgroundTransparency = 0.5
- frame.Visible = false
- frame.Parent = gui
- local label = Instance.new("TextLabel")
- label.Size = UDim2.new(1, 0, 1, 0)
- label.BackgroundTransparency = 1
- label.TextColor3 = Color3.fromRGB(255, 255, 255)
- label.TextScaled = true
- label.Parent = frame
- -- Detect Closest Enemy
- local function findClosestTarget()
- local closestPlayer, minDistance = nil, detectionRange
- for _, v in pairs(Players:GetPlayers()) do
- if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
- local dist = (LocalPlayer.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude
- if dist <= minDistance then
- minDistance = dist
- closestPlayer = v
- end
- end
- end
- return closestPlayer
- end
- -- Follow Closest Target
- local following = false
- local lastFollowUpdate = 0
- local function followTarget()
- if following then return end
- following = true
- RunService.Heartbeat:Connect(function()
- if tick() - lastFollowUpdate < frameUpdateRate or _G.Disabled then return end
- lastFollowUpdate = tick()
- local closestEnemy = findClosestTarget()
- if closestEnemy and closestEnemy.Character and closestEnemy.Character:FindFirstChild("HumanoidRootPart") then
- label.Text = "Following: " .. closestEnemy.Name
- frame.Visible = true
- local targetHRP = closestEnemy.Character.HumanoidRootPart
- for _, tool in pairs(LocalPlayer.Character:GetChildren()) do
- if tool:IsA("Tool") then
- local handle = tool:FindFirstChild("Handle")
- if handle then
- handle.Position = targetHRP.Position + Vector3.new(0, 2, 0)
- elseif tool.PrimaryPart then
- tool:SetPrimaryPartCFrame(targetHRP.CFrame * CFrame.new(0, 2, 0))
- end
- end
- end
- else
- frame.Visible = false
- end
- end)
- end
- followTarget()
- -- ESP + Hitbox + Emoji + Health Text (Optimized)
- local lastESPUpdate = 0
- RunService.RenderStepped:Connect(function()
- if tick() - lastESPUpdate < frameUpdateRate or _G.Disabled then return end
- lastESPUpdate = tick()
- for _, v in pairs(Players:GetPlayers()) do
- if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("Head") then
- pcall(function()
- local head = v.Character.Head
- head.Size = Vector3.new(_G.HeadSize, _G.HeadSize, _G.HeadSize)
- head.Transparency = 1
- head.BrickColor = BrickColor.new("Really black")
- head.Material = Enum.Material.Neon
- head.CanCollide = false
- head.Massless = true
- local hitbox = v.Character:FindFirstChild("Hitbox")
- if not hitbox then
- hitbox = Instance.new("Part")
- hitbox.Name = "Hitbox"
- hitbox.Size = _G.HitboxSize
- hitbox.Transparency = 0.2
- hitbox.BrickColor = BrickColor.new("Dark blue")
- hitbox.Material = Enum.Material.Neon
- hitbox.Anchored = true
- hitbox.CanCollide = false
- hitbox.Massless = true
- hitbox.Parent = v.Character
- local emoji = Instance.new("BillboardGui")
- emoji.Name = "Emoji"
- emoji.Size = UDim2.new(10, 0, 10, 0)
- emoji.Adornee = hitbox
- emoji.AlwaysOnTop = true
- emoji.Parent = hitbox
- local emojiText = Instance.new("TextLabel")
- emojiText.Name = "EmojiLabel"
- emojiText.Size = UDim2.new(1, 0, 1, 0)
- emojiText.BackgroundTransparency = 1
- emojiText.TextScaled = true
- emojiText.Font = Enum.Font.GothamBlack
- emojiText.TextColor3 = Color3.fromRGB(255, 255, 0)
- emojiText.TextStrokeTransparency = 0
- emojiText.Text = "😂"
- emojiText.Parent = emoji
- local healthGui = Instance.new("BillboardGui")
- healthGui.Name = "HealthGui"
- healthGui.Size = UDim2.new(5, 0, 1, 0)
- healthGui.StudsOffset = Vector3.new(0, 3, 0)
- healthGui.Adornee = hitbox
- healthGui.AlwaysOnTop = true
- healthGui.Parent = hitbox
- local healthLabel = Instance.new("TextLabel")
- healthLabel.Name = "HealthLabel"
- healthLabel.Size = UDim2.new(1, 0, 1, 0)
- healthLabel.BackgroundTransparency = 1
- healthLabel.TextColor3 = Color3.new(1, 1, 1)
- healthLabel.TextStrokeTransparency = 0.5
- healthLabel.TextScaled = true
- healthLabel.Parent = healthGui
- end
- hitbox.CFrame = head.CFrame * CFrame.new(0, 2, 0)
- local hum = v.Character:FindFirstChildOfClass("Humanoid")
- if hum then
- local hp = hum.Health
- local emojiGui = hitbox:FindFirstChild("Emoji")
- local healthGui = hitbox:FindFirstChild("HealthGui")
- if emojiGui and emojiGui:FindFirstChild("EmojiLabel") then
- local e = emojiGui.EmojiLabel
- if hp <= 35 then
- e.Text = "☠️"
- e.TextColor3 = Color3.fromRGB(255, 0, 0)
- else
- e.Text = "😂"
- e.TextColor3 = Color3.fromRGB(255, 255, 0)
- end
- end
- if healthGui and healthGui:FindFirstChild("HealthLabel") then
- healthGui.HealthLabel.Text = string.format("HP: %.0f", hp)
- end
- end
- end)
- end
- end
- end)
- -- Keybind Toggle
- UserInputService.InputBegan:Connect(function(input, processed)
- if not processed and input.KeyCode == _G.ToggleKey then
- _G.Disabled = not _G.Disabled
- frame.Visible = not _G.Disabled
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement