function decide (weighttable)
local weighttotal = 0
local weightranges = {}
for z,p in pairs(weighttable) do
table.insert(weightranges,{Item =} z,Min =} {weighttotal+1,Max} = weighttotal + p})
end
local match = nil
if weighttoal >0 then
local num =...