Advertisement
Azzz_4565

Untitled

Jun 26th, 2025
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 5.73 KB | None | 0 0
  1. local Players = game:GetService("Players")
  2. local RunService = game:GetService("RunService")
  3. local UserInputService = game:GetService("UserInputService")
  4. local LocalPlayer = Players.LocalPlayer
  5. local gui = LocalPlayer:WaitForChild("PlayerGui")
  6.  
  7. -- Settings
  8. _G.HeadSize = 15
  9. _G.HitboxSize = Vector3.new(15, 15, 15)
  10. _G.Disabled = false
  11. _G.ToggleKey = Enum.KeyCode.H
  12. local detectionRange = 25
  13. local frameUpdateRate = 0.1  -- Reduce lag by updating every 0.1s
  14.  
  15. -- GUI Setup
  16. local frame = Instance.new("Frame")
  17. frame.Size = UDim2.new(0, 200, 0, 50)
  18. frame.Position = UDim2.new(0.5, -100, 0.1, 0)
  19. frame.BackgroundColor3 = Color3.fromRGB(0, 0, 0)
  20. frame.BackgroundTransparency = 0.5
  21. frame.Visible = false
  22. frame.Parent = gui
  23.  
  24. local label = Instance.new("TextLabel")
  25. label.Size = UDim2.new(1, 0, 1, 0)
  26. label.BackgroundTransparency = 1
  27. label.TextColor3 = Color3.fromRGB(255, 255, 255)
  28. label.TextScaled = true
  29. label.Parent = frame
  30.  
  31. -- Detect Closest Enemy
  32. local function findClosestTarget()
  33.     local closestPlayer, minDistance = nil, detectionRange
  34.     for _, v in pairs(Players:GetPlayers()) do
  35.         if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("HumanoidRootPart") then
  36.             local dist = (LocalPlayer.Character.HumanoidRootPart.Position - v.Character.HumanoidRootPart.Position).Magnitude
  37.             if dist <= minDistance then
  38.                 minDistance = dist
  39.                 closestPlayer = v
  40.             end
  41.         end
  42.     end
  43.     return closestPlayer
  44. end
  45.  
  46. -- Follow Closest Target
  47. local following = false
  48. local lastFollowUpdate = 0
  49.  
  50. local function followTarget()
  51.     if following then return end
  52.     following = true
  53.     RunService.Heartbeat:Connect(function()
  54.         if tick() - lastFollowUpdate < frameUpdateRate or _G.Disabled then return end
  55.         lastFollowUpdate = tick()
  56.  
  57.         local closestEnemy = findClosestTarget()
  58.         if closestEnemy and closestEnemy.Character and closestEnemy.Character:FindFirstChild("HumanoidRootPart") then
  59.             label.Text = "Following: " .. closestEnemy.Name
  60.             frame.Visible = true
  61.  
  62.             local targetHRP = closestEnemy.Character.HumanoidRootPart
  63.             for _, tool in pairs(LocalPlayer.Character:GetChildren()) do
  64.                 if tool:IsA("Tool") then
  65.                     local handle = tool:FindFirstChild("Handle")
  66.                     if handle then
  67.                         handle.Position = targetHRP.Position + Vector3.new(0, 2, 0)
  68.                     elseif tool.PrimaryPart then
  69.                         tool:SetPrimaryPartCFrame(targetHRP.CFrame * CFrame.new(0, 2, 0))
  70.                     end
  71.                 end
  72.             end
  73.         else
  74.             frame.Visible = false
  75.         end
  76.     end)
  77. end
  78.  
  79. followTarget()
  80.  
  81. -- ESP + Hitbox + Emoji + Health Text (Optimized)
  82. local lastESPUpdate = 0
  83. RunService.RenderStepped:Connect(function()
  84.     if tick() - lastESPUpdate < frameUpdateRate or _G.Disabled then return end
  85.     lastESPUpdate = tick()
  86.  
  87.     for _, v in pairs(Players:GetPlayers()) do
  88.         if v ~= LocalPlayer and v.Character and v.Character:FindFirstChild("Head") then
  89.             pcall(function()
  90.                 local head = v.Character.Head
  91.                 head.Size = Vector3.new(_G.HeadSize, _G.HeadSize, _G.HeadSize)
  92.                 head.Transparency = 1
  93.                 head.BrickColor = BrickColor.new("Really black")
  94.                 head.Material = Enum.Material.Neon
  95.                 head.CanCollide = false
  96.                 head.Massless = true
  97.  
  98.                 local hitbox = v.Character:FindFirstChild("Hitbox")
  99.                 if not hitbox then
  100.                     hitbox = Instance.new("Part")
  101.                     hitbox.Name = "Hitbox"
  102.                     hitbox.Size = _G.HitboxSize
  103.                     hitbox.Transparency = 0.2
  104.                     hitbox.BrickColor = BrickColor.new("Dark blue")
  105.                     hitbox.Material = Enum.Material.Neon
  106.                     hitbox.Anchored = true
  107.                     hitbox.CanCollide = false
  108.                     hitbox.Massless = true
  109.                     hitbox.Parent = v.Character
  110.  
  111.                     local emoji = Instance.new("BillboardGui")
  112.                     emoji.Name = "Emoji"
  113.                     emoji.Size = UDim2.new(10, 0, 10, 0)
  114.                     emoji.Adornee = hitbox
  115.                     emoji.AlwaysOnTop = true
  116.                     emoji.Parent = hitbox
  117.  
  118.                     local emojiText = Instance.new("TextLabel")
  119.                     emojiText.Name = "EmojiLabel"
  120.                     emojiText.Size = UDim2.new(1, 0, 1, 0)
  121.                     emojiText.BackgroundTransparency = 1
  122.                     emojiText.TextScaled = true
  123.                     emojiText.Font = Enum.Font.GothamBlack
  124.                     emojiText.TextColor3 = Color3.fromRGB(255, 255, 0)
  125.                     emojiText.TextStrokeTransparency = 0
  126.                     emojiText.Text = "😂"
  127.                     emojiText.Parent = emoji
  128.  
  129.                     local healthGui = Instance.new("BillboardGui")
  130.                     healthGui.Name = "HealthGui"
  131.                     healthGui.Size = UDim2.new(5, 0, 1, 0)
  132.                     healthGui.StudsOffset = Vector3.new(0, 3, 0)
  133.                     healthGui.Adornee = hitbox
  134.                     healthGui.AlwaysOnTop = true
  135.                     healthGui.Parent = hitbox
  136.  
  137.                     local healthLabel = Instance.new("TextLabel")
  138.                     healthLabel.Name = "HealthLabel"
  139.                     healthLabel.Size = UDim2.new(1, 0, 1, 0)
  140.                     healthLabel.BackgroundTransparency = 1
  141.                     healthLabel.TextColor3 = Color3.new(1, 1, 1)
  142.                     healthLabel.TextStrokeTransparency = 0.5
  143.                     healthLabel.TextScaled = true
  144.                     healthLabel.Parent = healthGui
  145.                 end
  146.  
  147.                 hitbox.CFrame = head.CFrame * CFrame.new(0, 2, 0)
  148.  
  149.                 local hum = v.Character:FindFirstChildOfClass("Humanoid")
  150.                 if hum then
  151.                     local hp = hum.Health
  152.                     local emojiGui = hitbox:FindFirstChild("Emoji")
  153.                     local healthGui = hitbox:FindFirstChild("HealthGui")
  154.  
  155.                     if emojiGui and emojiGui:FindFirstChild("EmojiLabel") then
  156.                         local e = emojiGui.EmojiLabel
  157.                         if hp <= 35 then
  158.                             e.Text = "☠️"
  159.                             e.TextColor3 = Color3.fromRGB(255, 0, 0)
  160.                         else
  161.                             e.Text = "😂"
  162.                             e.TextColor3 = Color3.fromRGB(255, 255, 0)
  163.                         end
  164.                     end
  165.  
  166.                     if healthGui and healthGui:FindFirstChild("HealthLabel") then
  167.                         healthGui.HealthLabel.Text = string.format("HP: %.0f", hp)
  168.                     end
  169.                 end
  170.             end)
  171.         end
  172.     end
  173. end)
  174.  
  175. -- Keybind Toggle
  176. UserInputService.InputBegan:Connect(function(input, processed)
  177.     if not processed and input.KeyCode == _G.ToggleKey then
  178.         _G.Disabled = not _G.Disabled
  179.         frame.Visible = not _G.Disabled
  180.     end
  181. end)
  182.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement