Jump to content




Interval Empty?


  • You cannot reply to this topic
3 replies to this topic

#1 Agoldfish

  • Members
  • 451 posts
  • LocationSome Fish Bowl in Ohio.

Posted 15 November 2013 - 01:53 PM

Hi, I was writing a program, and I have the following for line 1.

local weather = math.random(60-90)

And I get:
Race:1:  bad argument  #1: interval is empty 

What the heck is that? I have worked with variables before and that has never showed up before.
Thanks to anyone who helps.

#2 nolongerexistant

  • Validating
  • 201 posts
  • LocationNetherlands

Posted 15 November 2013 - 02:03 PM

local weather = math.random(60-90)

You have to use a comma instead of a minus

local weather = math.random(60, 90)

Edited by Snakybo, 15 November 2013 - 02:05 PM.


#3 Engineer

  • Members
  • 1,378 posts
  • LocationThe Netherlands

Posted 15 November 2013 - 02:04 PM

Read documentation

So it generally accepts two arguments, in your case:
math.random( 60, 90 )

Edit: Ninja's, ninja's everywhere!

Edited by Engineer, 15 November 2013 - 02:04 PM.


#4 Agoldfish

  • Members
  • 451 posts
  • LocationSome Fish Bowl in Ohio.

Posted 15 November 2013 - 03:36 PM

I feel sooooo dumb. -_-





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users