Advertisement
HairBaconGamming

noob in combat esp

May 2nd, 2024
656
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 4.41 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2. local Mouse = Player:GetMouse()
  3.  
  4. local UntityMaxHealth = {}
  5.  
  6. local Chosing
  7.  
  8. function FindFirstDescendantWhichIsA(Object:Instance,ClassName:string)
  9.     for i,descendant:Instance in pairs(Object:GetDescendants()) do
  10.         if descendant:IsA(ClassName) then
  11.             return descendant
  12.         end
  13.     end
  14. end
  15.  
  16. function createheadtag(entity:Model)
  17.     local BillboardGui = Instance.new("BillboardGui")
  18.     local Frame = Instance.new("Frame")
  19.     local TextLabel = Instance.new("TextLabel")
  20.     local Frame_1 = Instance.new("Frame")
  21.     local Frame_2 = Instance.new("Frame")
  22.     local TextLabel_1 = Instance.new("TextLabel")
  23.  
  24.     BillboardGui.Active = true
  25.     BillboardGui.AlwaysOnTop = true
  26.     BillboardGui.ClipsDescendants = true
  27.     BillboardGui.LightInfluence = 1
  28.     BillboardGui.Size = UDim2.new(7, 0, 1.5, 0)
  29.     BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
  30.     BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
  31.  
  32.     Frame.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
  33.     Frame.BackgroundTransparency = 1
  34.     Frame.BorderColor3 = Color3.new(0, 0, 0)
  35.     Frame.BorderSizePixel = 0
  36.     Frame.Parent = BillboardGui
  37.     Frame.Size = UDim2.new(1, 0, 1, 0)
  38.  
  39.     TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
  40.     TextLabel.BackgroundTransparency = 1
  41.     TextLabel.BorderColor3 = Color3.new(0, 0, 0)
  42.     TextLabel.BorderSizePixel = 0
  43.     TextLabel.Font = Enum.Font.Unknown
  44.     TextLabel.Parent = Frame
  45.     TextLabel.Position = UDim2.new(0.0459183678, 0, 0.162790701, 0)
  46.     TextLabel.Size = UDim2.new(0.918367326, 0, 0.399709314, 0)
  47.     TextLabel.Text = [[Entity]]
  48.     TextLabel.TextColor3 = Color3.new(1, 1, 1)
  49.     TextLabel.TextScaled = true
  50.     TextLabel.TextSize = 14
  51.     TextLabel.TextStrokeTransparency = 0
  52.     TextLabel.TextWrapped = true
  53.     TextLabel.TextXAlignment = Enum.TextXAlignment.Left
  54.  
  55.     Frame_1.BackgroundColor3 = Color3.new(1, 1, 1)
  56.     Frame_1.BorderColor3 = Color3.new(0, 0, 0)
  57.     Frame_1.BorderSizePixel = 0
  58.     Frame_1.Parent = Frame
  59.     Frame_1.Position = UDim2.new(0.0410000011, 0, 0.662, 0)
  60.     Frame_1.Size = UDim2.new(0.917999983, 0, 0.25, 0)
  61.  
  62.     Frame_2.BackgroundColor3 = Color3.new(0.333333, 1, 0.498039)
  63.     Frame_2.BorderColor3 = Color3.new(0, 0, 0)
  64.     Frame_2.BorderSizePixel = 0
  65.     Frame_2.Parent = Frame_1
  66.     Frame_2.Size = UDim2.new(0.5, 0, 1, 0)
  67.  
  68.     TextLabel_1.BackgroundColor3 = Color3.new(1, 1, 1)
  69.     TextLabel_1.BackgroundTransparency = 1
  70.     TextLabel_1.BorderColor3 = Color3.new(0, 0, 0)
  71.     TextLabel_1.BorderSizePixel = 0
  72.     TextLabel_1.Font = Enum.Font.Unknown
  73.     TextLabel_1.Parent = Frame_1
  74.     TextLabel_1.Size = UDim2.new(1, 0, 1, 0)
  75.     TextLabel_1.Text = [[0/100]]
  76.     TextLabel_1.TextColor3 = Color3.new(1, 1, 1)
  77.     TextLabel_1.TextScaled = true
  78.     TextLabel_1.TextSize = 14
  79.     TextLabel_1.TextStrokeTransparency = 0
  80.     TextLabel_1.TextWrapped = true
  81.    
  82.     local Part = Instance.new("Part",entity)
  83.     Part.Transparency = 1
  84.     Part.CanCollide = false
  85.     Part.Anchored = true
  86.     Part.Size = Vector3.new(1,1,1)
  87.     local abc = FindFirstDescendantWhichIsA(entity,"BasePart")
  88.     Part.CFrame = (abc and abc.CFrame) or entity.WorldPivot
  89.     BillboardGui.Parent = Part
  90.     return BillboardGui,TextLabel_1,Frame_2
  91. end
  92.  
  93. for i,data in pairs(workspace.Collision:GetChildren()) do
  94.     UntityMaxHealth[data.Name] = data.health.Value
  95. end
  96.  
  97. local HiddenEntity = Instance.new("Folder",workspace)
  98. HiddenEntity.Name = game:GetService("HttpService"):GenerateGUID(false)
  99.  
  100. _G.End = true
  101.  
  102. function update(debristime)
  103.     for i,hidden:Model in pairs(game.ReplicatedStorage.HIDDEN_UNITS:GetChildren()) do
  104.         local clone = hidden:Clone()
  105.         clone.Parent = HiddenEntity
  106.         local highlight = Instance.new("Highlight",clone)
  107.         highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
  108.         highlight.FillColor = Color3.new(1,0,0)
  109.         highlight.OutlineTransparency = 1
  110.         highlight.FillTransparency = 0.7
  111.         if UntityMaxHealth[hidden.Name] and workspace.Collision[hidden.Name] then
  112.             local bill,healthlabel,bar = createheadtag(clone)
  113.             bill.Frame.TextLabel.Text = game:GetService("HttpService"):GenerateGUID(false)
  114.             healthlabel.Text = math.round(workspace.Collision[hidden.Name].health.Value/UntityMaxHealth[hidden.Name]*100)
  115.             bar.Size = UDim2.fromScale(workspace.Collision[hidden.Name].health.Value/UntityMaxHealth[hidden.Name],1)
  116.         end
  117.         game.Debris:AddItem(clone,debristime)
  118.     end
  119. end
  120.  
  121. local secondperframe = 0.5
  122.  
  123. local tdt = 0
  124. game:GetService("RunService").Heartbeat:Connect(function(deltaTime)
  125.     tdt += deltaTime
  126.     if tdt >= secondperframe then
  127.         tdt = 0
  128.         update(secondperframe)
  129.     end
  130. end)
  131.  
  132. HiddenEntity:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement