How can i make a leaderstat boost when you have something equipped

How can i make something so that when i equip like a hat my leaderstat Value will be boosted x2? and when its unequipped it goes down to x1 again?

You can set it accordingly to when u equip/unequip ur hat or whatever. Here is an example using an tool

local tool = script.Parent

local boost = 1
tool.Equipped:Connect(function()
    boost = 2
end)
tool.Unequipped:Connect(function()
    boost = 1
end)
Tool.Activated:Connect(function()
    plr.leaderstats.Power += 1 * Boost
end)