Leg0brick
|
  |
| Joined: 24 Jul 2012 |
| Total Posts: 651 |
|
|
| 10 Feb 2015 11:13 PM |
This bit of code: b.Position = Vector3.new(math.random(55,60),math.random(90,90),math.random(130,30)) Gives me this error: 21:10:17.855 - Workspace.Part.Script:6: bad argument #2 to 'random' (interval is empty) Please help! Thanks for reading! |
|
|
| Report Abuse |
|
|
| |
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 10 Feb 2015 11:16 PM |
| Your Z axis.. you're trying to get a random number in between 130 and 30, 130 being minimum and 30 being maximum.. see why that errors? Change it. |
|
|
| Report Abuse |
|
|
128GB
|
  |
| Joined: 17 Apr 2014 |
| Total Posts: 8056 |
|
|
| 10 Feb 2015 11:20 PM |
too bad math.random doesn't work like this
local function random(x, y) if (x) then return math.random(math.min(x, (y or 1)), math.max(x, (y or 1))); else return math.random(); end end
print(random()) -->random number from 0 to 1, not int
print(random(10)) -->random number from 1 to 10
print(random(-10)) -->random number from -10 to 1
print(random(5, 10)) -->random number from 5 to 10
print(random(10, 5)) -->random number from 5 to 10 |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 11 Feb 2015 12:34 AM |
| math.random(90,90) im not sure but better write 90+math.random() if you want it between them |
|
|
| Report Abuse |
|
|
Skyman772
|
  |
| Joined: 20 Mar 2012 |
| Total Posts: 9305 |
|
|
| 11 Feb 2015 10:02 AM |
Why would you do math.random(90,90)? That's always going to print 90 - it would be much more efficient for you to just do:
b.Position = Vector3.new(math.random(55,60),90,math.random(30,130)) |
|
|
| Report Abuse |
|
|