I want this script to create a bloody screen as a player's health is dropping. The image will become denser and denser as the player's health becomes lower and lower. Can anyone solve this? I'm new to scripting and some of you may ignore this because it is so simple, it's just that I can't figure it out myself.
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <100 then
script.Parent.ImageTransparency = 0.1
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <90 then
script.Parent.ImageTransparency = 0.2
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <80 then
script.Parent.ImageTransparency = 0.3
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <70 then
script.Parent.ImageTransparency = 0.4
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <60 then
script.Parent.ImageTransparency = 0.5
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <50 then
script.Parent.ImageTransparency = 0.6
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <40 then
script.Parent.ImageTransparency = 0.7
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <30 then
script.Parent.ImageTransparency = 0.8
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <20 then
script.Parent.ImageTransparency = 0.9
if script.Parent.Parent.Parent.Parent.Parent.Humanoid.Health <10 then
script.Parent.ImageTransparency = 1
end
end
end
end
end
end
end
end
end
end

1 comment
Forgot to put an explaintion: First. What it does is that find your hp and divide by 100 so if you have fullHp your image transparency will be 1(Invisible) else if you have like 50 hp then the image will have a transparency of 0.5 wich is semi invisible, i don't think it's hard to understand what i coded. Have a good day!