Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local HealthBarColor = Color3.fromRGB(125, 255, 78)
- local HealthBar = Instance.new("Frame")
- HealthBar.Parent = script.Parent
- HealthBar.Position = UDim2.new(0,0,0,0)
- HealthBar.BorderSizePixel = 0
- HealthBar.Size = script.Parent.Size
- HealthBar.BackgroundColor3 = HealthBarColor
- local Humanoid = script:FindFirstAncestorWhichIsA("Player").Character:WaitForChild("Humanoid")
- Humanoid:GetPropertyChangedSignal("Health"):Connect(function()
- HealthBar.Size = UDim2.new(HealthBar.Size.X.Scale,Humanoid.Health * script.Parent.AbsoluteSize.X / 100,HealthBar.Size.Y.Scale,HealthBar.Size.Y.Offset)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement