Inversely proportional values

Hi, I’m trying to increase the blur from 0-10 as my health lowers from 1800-0. How would I make both values inversely proportional?

By calculating the percentage.

local player = game:GetService("Players").LocalPlayer
local character = player.Character or player.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local TRESHOLD = 1800

local blur = game:GetService("Lighting").Blur

blur.Size = 0
humanoid.MaxHealth = 1800
humanoid.Health = 1800

humanoid.HealthChanged:Connect(function(health)
	local percent = (TRESHOLD - health)/TRESHOLD
	print(percent)
	blur.Size = 10 * percent
end)

Which means (1 - health/1800). Then we take this percentage from maximal blur size.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.