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?
local Player = game:GetService("Players").LocalPlayer local Character = Player.Character or Player.CharacterAdded:Wait() local PlayerUI = Player:WaitForChild("PlayerGui") local BloodEffect = PlayerUI:WaitForChild("ScreenEffects"):WaitForChild("Blood") Character.Humanoid.HealthChanged:Connect(function(NewHealth) if NewHealth >= 80 and NewHealth <= 99 then for i = 0,.9,.05 do BloodEffect.ImageTransparency = i wait() end else if NewHealth >= 60 and NewHealth <= 79 then for i = 0,.7,.05 do BloodEffect.ImageTransparency = i wait() end end end end)