I'm currently making a kind of wasteland game, and I have a script to make the players screen get redder depending on their health.
while true do
script.Parent.ImageTransparency = humanoid.Health / 100
wait()
end
I want to make a ear ringing sound get louder depending on how low the players health is, but I'm not sure how to do that.
while true do
script.Parent.ImageTransparency = humanoid.Health / 100
script.Parent.Parent.Sound.Volume = humanoid.Health / 100 -- a way to reverse the value???
wait()
end
I'm just a bit confused on how to do this.
**EDIT - CONTEXT: ** I want the sound to be silent at full health, but get louder as the players health goes down. I should have added this in first. bruh

1 comment
Use 1-(health/100). This way, when health is at numbers like 100 and 100/100=1 and 1-1=0 and at 25, 25/100=.25 and 1-.25=.75, you can set that as the volume and scale it up by multiplying it to make it louder.