Advertisement
Guest User

Untitled

a guest
Sep 4th, 2022
6,787
1
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.57 KB | None | 1 0
  1. game:GetService("StarterGui"):SetCoreGuiEnabled(Enum.CoreGuiType.Health, false)
  2.  
  3. local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
  4. local humanoid = character:WaitForChild("Humanoid")
  5.  
  6. local function update()
  7.     script.Parent.TextLabel.Text = humanoid.Health.." / "..humanoid.MaxHealth
  8.     script.Parent.Health:TweenSize(UDim2.new(humanoid.Health/humanoid.MaxHealth,0,1,0), "Out", "Linear", 0.25)
  9. end
  10.  
  11. humanoid:GetPropertyChangedSignal("Health"):Connect(update)
  12. humanoid:GetPropertyChangedSignal("MaxHealth"):Connect(update)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement