Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --local script
- local player = game.Players.LocalPlayer
- local char = player.Character or player.CharacterAdded:wait()
- local human = char:WaitForChild('Humanoid')
- local maxhealth = human.MaxHealth
- local redzone = maxhealth/4
- local red = Color3. from RGB (255,0,0)
- local green = Color3.fromRGB(0,255,0)
- local gui = script.Parent
- human.HealthChanged:connect(function(newhealth)
- gui.BackgroundColor3 = human.Health <= redzone and red or green
- gui:TweenSize(UDim2.new(newhealth/maxhealth),'Out','Quad',1)
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement