Help with creating a luck system in weighted rng

I am creating a sols rng like game for practice and currently trying to create a luck system. How would i do this.

Module Script:

local module = {
	["item1"] = 0.3,
	["item3"] = 0.01,
	["item2"] = 0.123,
}

return module

MainScript:

local itemData = require(script.ItemData)

game.Players.PlayerAdded:Connect(function(plr)
	local localItemData = {}
	
	localItemData = itemData

	print(localItemData)
	
	local rollUI = plr.PlayerGui:WaitForChild("ScreenGui")
	local rollButton = rollUI.TextButton

	rollButton.MouseButton1Click:Connect(function()
		local weight = 0
		local savedWeight = 0
		local highestNumLen = 0

		for i, v in pairs(localItemData) do
			if highestNumLen < string.len(v) - 2 then
				highestNumLen = string.len(v) - 2
			end
		end

		for i, v in pairs(localItemData) do
			weight += v * 10 ^ highestNumLen
			savedWeight = weight
		end
		
		local rand = math.random(1, weight)
		
		weight = 0
		
		for i, v in pairs(localItemData) do
			weight += v * 10 ^ highestNumLen
			
			if weight >= rand then
				print("bro got "..i)
				print(i.." percent is "..(v * 10 ^ highestNumLen/savedWeight * 100).."%")
				print(i.." chanse is 1 in "..savedWeight / (v * 10 ^ highestNumLen))
				break
			end
		end
	end)
end)

I would like it so that a player has like a percentage of luck or something like that.
For example:
100% luck = 2x luck

Also would appreciate some feedback on the code