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

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

Asked by 6 years ago
Edited 6 years ago

I'm using math.random to get a random position but i get this error_

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

how do i fix this?

here is exactly what i'm using.

Vector3.new(math.random(10,-10) , 0 , math.random(10,-10))

1 answer

Log in to vote
2
Answered by 6 years ago

Just swap the values from low to high

Vector3.new(math.random(-10,10) , 0 , math.random(-10,10))
Ad

Answer this question