Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- local UntityMaxHealth = {}
- local Chosing
- function FindFirstDescendantWhichIsA(Object:Instance,ClassName:string)
- for i,descendant:Instance in pairs(Object:GetDescendants()) do
- if descendant:IsA(ClassName) then
- return descendant
- end
- end
- end
- function createheadtag(entity:Model)
- local BillboardGui = Instance.new("BillboardGui")
- local Frame = Instance.new("Frame")
- local TextLabel = Instance.new("TextLabel")
- local Frame_1 = Instance.new("Frame")
- local Frame_2 = Instance.new("Frame")
- local TextLabel_1 = Instance.new("TextLabel")
- BillboardGui.Active = true
- BillboardGui.AlwaysOnTop = true
- BillboardGui.ClipsDescendants = true
- BillboardGui.LightInfluence = 1
- BillboardGui.Size = UDim2.new(7, 0, 1.5, 0)
- BillboardGui.StudsOffset = Vector3.new(0, 3, 0)
- BillboardGui.ZIndexBehavior = Enum.ZIndexBehavior.Sibling
- Frame.BackgroundColor3 = Color3.new(0.137255, 0.137255, 0.137255)
- Frame.BackgroundTransparency = 1
- Frame.BorderColor3 = Color3.new(0, 0, 0)
- Frame.BorderSizePixel = 0
- Frame.Parent = BillboardGui
- Frame.Size = UDim2.new(1, 0, 1, 0)
- TextLabel.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel.BackgroundTransparency = 1
- TextLabel.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel.BorderSizePixel = 0
- TextLabel.Font = Enum.Font.Unknown
- TextLabel.Parent = Frame
- TextLabel.Position = UDim2.new(0.0459183678, 0, 0.162790701, 0)
- TextLabel.Size = UDim2.new(0.918367326, 0, 0.399709314, 0)
- TextLabel.Text = [[Entity]]
- TextLabel.TextColor3 = Color3.new(1, 1, 1)
- TextLabel.TextScaled = true
- TextLabel.TextSize = 14
- TextLabel.TextStrokeTransparency = 0
- TextLabel.TextWrapped = true
- TextLabel.TextXAlignment = Enum.TextXAlignment.Left
- Frame_1.BackgroundColor3 = Color3.new(1, 1, 1)
- Frame_1.BorderColor3 = Color3.new(0, 0, 0)
- Frame_1.BorderSizePixel = 0
- Frame_1.Parent = Frame
- Frame_1.Position = UDim2.new(0.0410000011, 0, 0.662, 0)
- Frame_1.Size = UDim2.new(0.917999983, 0, 0.25, 0)
- Frame_2.BackgroundColor3 = Color3.new(0.333333, 1, 0.498039)
- Frame_2.BorderColor3 = Color3.new(0, 0, 0)
- Frame_2.BorderSizePixel = 0
- Frame_2.Parent = Frame_1
- Frame_2.Size = UDim2.new(0.5, 0, 1, 0)
- TextLabel_1.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel_1.BackgroundTransparency = 1
- TextLabel_1.BorderColor3 = Color3.new(0, 0, 0)
- TextLabel_1.BorderSizePixel = 0
- TextLabel_1.Font = Enum.Font.Unknown
- TextLabel_1.Parent = Frame_1
- TextLabel_1.Size = UDim2.new(1, 0, 1, 0)
- TextLabel_1.Text = [[0/100]]
- TextLabel_1.TextColor3 = Color3.new(1, 1, 1)
- TextLabel_1.TextScaled = true
- TextLabel_1.TextSize = 14
- TextLabel_1.TextStrokeTransparency = 0
- TextLabel_1.TextWrapped = true
- local Part = Instance.new("Part",entity)
- Part.Transparency = 1
- Part.CanCollide = false
- Part.Anchored = true
- Part.Size = Vector3.new(1,1,1)
- local abc = FindFirstDescendantWhichIsA(entity,"BasePart")
- Part.CFrame = (abc and abc.CFrame) or entity.WorldPivot
- BillboardGui.Parent = Part
- return BillboardGui,TextLabel_1,Frame_2
- end
- for i,data in pairs(workspace.Collision:GetChildren()) do
- UntityMaxHealth[data.Name] = data.health.Value
- end
- local HiddenEntity = Instance.new("Folder",workspace)
- HiddenEntity.Name = game:GetService("HttpService"):GenerateGUID(false)
- _G.End = true
- function update(debristime)
- for i,hidden:Model in pairs(game.ReplicatedStorage.HIDDEN_UNITS:GetChildren()) do
- local clone = hidden:Clone()
- clone.Parent = HiddenEntity
- local highlight = Instance.new("Highlight",clone)
- highlight.DepthMode = Enum.HighlightDepthMode.AlwaysOnTop
- highlight.FillColor = Color3.new(1,0,0)
- highlight.OutlineTransparency = 1
- highlight.FillTransparency = 0.7
- if UntityMaxHealth[hidden.Name] and workspace.Collision[hidden.Name] then
- local bill,healthlabel,bar = createheadtag(clone)
- bill.Frame.TextLabel.Text = game:GetService("HttpService"):GenerateGUID(false)
- healthlabel.Text = math.round(workspace.Collision[hidden.Name].health.Value/UntityMaxHealth[hidden.Name]*100)
- bar.Size = UDim2.fromScale(workspace.Collision[hidden.Name].health.Value/UntityMaxHealth[hidden.Name],1)
- end
- game.Debris:AddItem(clone,debristime)
- end
- end
- local secondperframe = 0.5
- local tdt = 0
- game:GetService("RunService").Heartbeat:Connect(function(deltaTime)
- tdt += deltaTime
- if tdt >= secondperframe then
- tdt = 0
- update(secondperframe)
- end
- end)
- HiddenEntity:Destroy()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement