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

What does this Output error mean? [closed]

Asked by 10 years ago

bad argument #2 to 'random' (interval is empty)

I don't know what that means, can someone tell me what it means?

2
You have a math.random statement and the second number is less than the first. GoldenPhysics 474 — 10y
0
Thanks! Coolviper630 95 — 10y

Locked by BlueTaslem

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
0
Answered by
BlueTaslem 18071 Moderation Voter Administrator Community Moderator Super Administrator
10 years ago

GoldenPhysics's answer:

You have a math.random statement and the second number is less than the first.


That is, something like

math.random( 5 , 0 )

When explicit numbers aren't typed, it will frequently be from code that looks like this:

math.random( 1, #tab )

Which will cause a problem if tab is empty (since 1 > 0).

Ad