I am trying to make a crate system. I have Commons, Rares, Legends, and Godly's. Everything unboxes just fine but when I try to unbox the Godly Crate This Error Shows, " . Allbad argument #2 to 'random' (interval is empty)" Crates run through the same script, so I don't get why it does this. Help if you can! Here is the part of the codes that shows the error,
local Choose = math.random(1,100);
local ChanceTable = {};
for Rarity,Chance in pairs(Chances) do
for i = 1,Chance do
table.insert(ChanceTable,Rarity);
end
end;
SelectedRarity = ChanceTable[math.random(1,#ChanceTable)];
SelectedKnife = ItemTable[SelectedRarity][math.random(1,#ItemTable[SelectedRarity])]; -- Shows the error on this line
ChanceTable = {};

2 comments
https://scriptinghelpers.org/questions/15854/serverscriptservicegame17-bad-argument-2-to-random-interval-is-empty
That doesn't really help, all crates open but one specific one. And they are all ran through one script.