I want to make a call of duty death screen so its like when you are injured/ losing health, the screen starts to turn red. The screen either slowly goes away if you are not being injured or the screen will be bloody red when you are dead. I tried to make a script that would work like that but its not working and Idk if im right or not. This script is under an image label btw.
Player = script.Parent.Parent.Parent.Parent.Character
s = Player.Humanoid
while true do
if s.Health <= 90 then
script.Parent.ImageTransparency = .1
script.Parent.Visible = true
while true do
if s.Health <= 80 then
script.Parent.ImageTransparency = .2
script.Parent.Visible = true
while true do
if s.Health <= 70 then
script.Parent.ImageTransparency = .3
script.Parent.Visible = true
while true do
if s.Health <= 60 then
script.Parent.ImageTransparency = .4
script.Parent.Visible = true
if s.Health >= 50 then
script.Parent.ImageTransparency = .5
script.Parent.Visible = true
while true do
if s.Health <= 40 then
script.Parent.ImageTransparency = .6
script.Parent.Visible = true
while true do
if s.Health <= 30 then
script.Parent.ImageTransparency = .7
script.Parent.Visible = true
while true do
if s.Health <= 20 then
script.Parent.ImageTransparency = .8
script.Parent.Visible = true
while true do
if s.Health <= 10 then
script.Parent.ImageTransparency = .9
script.Parent.Visible = true
while true do
if s.Health <= 0 then
script.Parent.ImageTransparency = 0
script.Parent.Visible = true
end
end

4 comments
why even use
ifs when the formula for Transparency in terms of Health is so simple?Updated. Thanks for pointing that out, lol.
Thank you so much!! The both of you! You guys are life savers!
Haha, no prob. Glad I could help.