Scaling light range and transparency with part

Essentially, I want to make a pointlight inside of a part that constantly scales with the said parts size and transparency. I want it to get further when the part gets bigger, and less transparent/bright with the parts transparency increased.

My questions are:

How would I go about doing it? I want it to be auto-managed, so a loop preferably would work.

How would I make it so it’s well calibrated? How would I go about the math to ensure the light is at the same ratio as the part increase?

I am not planning to use this on huge parts, just parts and explosions for my magic. I don’t want to tween the lights seperately to the part is all.

Lag isnt a huge issue here, fear not.

You can use changed function to do this.
There is an example:

local Part = workspace:WaitForChild("Part",30)
local Light = Part and Part:FindFirstChildWhichIsA("PointLight")

Part:GetPropertyChangedSignal("Size"):Connect(function()
	Light.Range = (Part.Size.X + Part.Size.Y + Part.Size.Z) / 2
end)

Part:GetPropertyChangedSignal("Transparency"):Connect(function()
	Light.Brightness = 15 - (Part.Transparency * 15)
end)

I’ll try this out and let you know how it works. Thanks!