I am trying to make a pet hatching module script and when I put in this: local chosenPet = rarityTable[math.random(1,#rarityTable)]. It said : ServerScriptService.PetMod:49: invalid argument #2 to 'random' (interval is empty). I can't figure out the problem.
COMMUNITY QUESTION
Invaild argument #2 to 'random' (Interval is empty)?
0 answers
No public answers were preserved for this question.
This discussion is preserved as it was. New answers, comments, and votes are closed.

8 comments
Your array is empty.
?
Read, buddy. Your array is empty.
math.random() requires a scope between two digits of either equal or greater differentials. The length operator will determine the amount of attributes within your array. If this exception is being raised, the amount of attributes—through context—is 0, I.e empty.
or negative :brain:
Wait I think I figured it out I will get back to you if it works
Nope
XD just poop LOL