Advertisement
Guest User

Untitled

a guest
Apr 30th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.51 KB | None | 0 0
  1. --local script
  2.  
  3. local player = game.Players.LocalPlayer
  4. local char = player.Character or player.CharacterAdded:wait()
  5. local human = char:WaitForChild('Humanoid')
  6. local maxhealth = human.MaxHealth
  7. local redzone = maxhealth/4
  8. local red = Color3. from RGB (255,0,0)
  9. local green = Color3.fromRGB(0,255,0)
  10. local gui = script.Parent
  11.  
  12. human.HealthChanged:connect(function(newhealth)
  13.     gui.BackgroundColor3 = human.Health <= redzone and red or green
  14.     gui:TweenSize(UDim2.new(newhealth/maxhealth),'Out','Quad',1)
  15. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement