Slowly fade blood onto the players screen as they take damage?
I am trying to make a script that will slowly fade blood onto the players screen. The amount of blood shown will slowly increase the lower their health gets.
I started to attempt this myself, but the way I am doing it seems inefficient. Is there a better way other than manually stating the health values?
01 | local Player = game:GetService( "Players" ).LocalPlayer |
02 | local Character = Player.Character or Player.CharacterAdded:Wait() |
04 | local PlayerUI = Player:WaitForChild( "PlayerGui" ) |
05 | local BloodEffect = PlayerUI:WaitForChild( "ScreenEffects" ):WaitForChild( "Blood" ) |
07 | Character.Humanoid.HealthChanged:Connect( function (NewHealth) |
08 | if NewHealth > = 80 and NewHealth < = 99 then |
10 | BloodEffect.ImageTransparency = i |
13 | else if NewHealth > = 60 and NewHealth < = 79 then |
15 | BloodEffect.ImageTransparency = i |