Not sure at all but just assuming, instead of underscore in the in-pair loop, Prize would be the identifier for the key.
Like this -
for Prize, Chance in pairs(prizeTable) do
Weight +=(Chance * 10)
if Weight >= ranNumber then
print('Congrats you won '..Prize)
break
end
end
This isn’t related to the error shown in the console in any way though.
The error is because, math.random(m,n)
if (n < m) then it will throw the error. Like in your case.