Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Invaild argument #2 to 'random' (Interval is empty)?

Asked by
lomo598 -7
3 years ago

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.

2
Your array is empty. Ziffixture 6913 — 3y
0
? lomo598 -7 — 3y
0
Read, buddy. Your array is empty. incapaz 195 — 3y
0
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. Ziffixture 6913 — 3y
View all comments (4 more)
0
or negative :brain: incapaz 195 — 3y
0
Wait I think I figured it out I will get back to you if it works lomo598 -7 — 3y
0
Nope lomo598 -7 — 3y
0
XD just poop LOL Kyrillos3121 -3 — 3y

Answer this question