Advertisement
SourceYT

Health bar script

Dec 18th, 2020
605
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.30 KB | None | 0 0
  1. local player = game.Players.LocalPlayer
  2. local character = player.Character or player.CharacterAdded:Wait()
  3. local humanoid = character:WaitForChild("Humanoid")
  4.  
  5. local text = script.Parent
  6.  
  7. humanoid.HealthChanged:Connect(function()
  8.     script.Parent.Text = "HP: " .. math.floor(humanoid.Health) .. "%"
  9. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement