|
| 20 Jan 2011 05:51 AM |
I am trying to make exhaust from a rocket thruster from my free-model-free space cruiser but... The 8th line has a few problems and I don't know what D:
while true do p = Instance.new("Part") p.ParenWorkspace.Part.Script:8: bad argument #2 to 'random' (interval is empty)t = game.Workspace p.Name = "Fuel" p.Anchored = true p.Position = Vector3.new(math.random(script.Parent.Position.x + 20, script.Parent.Position.x - 20), math.random(script.Parent.Position.y + 20, script.Parent.Position.y - 20), math.random(script.Parent.Position.z + 20, script.Parent.Position.z - 20)) p.CanCollide = false p.BrickColor = BrickColor.new("Neon orange") p:BreakJoints() wait() end
Workspace.Part.Script:8: bad argument #2 to 'random' (interval is empty)
it says "interval is empty", but it's not... what SHOULD I have in there instead of what I do have in there?
BTW before you say I'm a noob, this account is a new account, yes, but it's an alt. my main, comiconor, is an 09er. |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2011 05:57 AM |
If it said "interval empty", then you put the higher number in math.random first. Just switch it around, and it should work fine. By that, I mean always have the lower number first.
math.random(0,13) <-- GOOD
math.random(7,2) <-- BAD |
|
|
| Report Abuse |
|
|
WhileTrue
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 242 |
|
|
| 20 Jan 2011 06:02 AM |
No one would say you a noob.
Also, do you mean this line?
p.Position = Vector3.new(math.random(script.Parent.Position.x + 20, script.Parent.Position.x - 20), math.random(script.Parent.Position.y + 20, script.Parent.Position.y - 20), math.random(script.Parent.Position.z + 20, script.Parent.Position.z - 20))
I don't know, the forum automatically adds line breaks. If it was this line, maybe "script.Parent.Position.x" isn't a numerical value. |
|
|
| Report Abuse |
|
|
|
| 20 Jan 2011 06:03 AM |
| script.Parent.Position.X IS, though. You need the uppercase. |
|
|
| Report Abuse |
|
|
WhileTrue
|
  |
| Joined: 19 Jan 2011 |
| Total Posts: 242 |
|
|
| 20 Jan 2011 06:03 AM |
| Or.. bunny's solution. Try putting "math.random(script.Parent.Position.x - 20, script.Parent.Position.x + 20), " instead of "math.random(script.Parent.Position.x +- 20, script.Parent.Position.x - 20), " |
|
|
| Report Abuse |
|
|
|
| 21 Jan 2011 05:38 AM |
| got it! lowest interval first, got it. |
|
|
| Report Abuse |
|
|
HyperBlue
|
  |
| Joined: 06 Aug 2009 |
| Total Posts: 1166 |
|
|
| 21 Jan 2011 05:56 AM |
| The capitalization of the Vector3 elements doesn't matter. |
|
|
| Report Abuse |
|
|