|
| 22 Dec 2013 08:14 AM |
tele = teles[math.random(1,#teles)] x1 = tele.Position.X-(tele.Size.X/2) x2 = tele.Position.X+(tele.Size.X/2) z1 = tele.Position.Z-(tele.Size.Z/2) z2 = tele.Position.Z+(tele.Size.Z/2) obj.Character.Torso.CFrame = CFrame.new(math.random(x1,x2),tele.Position.Y+5,math.random(z1,z2)) ================================================================================== On the first line it has tele = teles[math.random(1,#teles)] but the argument of the math.random head no interval (1,#teles) < what do I do to put an interval? ---------------------------------------------------------------------------------- Thanks and no harsh comments please, Rockandgreen |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 08:19 AM |
| You don't got a table called "teles" |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:27 AM |
| vle I dont get what you mean and by the way this is pat of a much bigger script. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 08:28 AM |
| Post the full script then. |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:29 AM |
| On the output window on my game when we play the rounds it hits this coding and stops because it say in the output window that there needs to be an interval... |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:30 AM |
| Erm if I do it is lke 500 lines long so....... yeah |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 22 Dec 2013 08:32 AM |
| ........ I cant help then, sorry. |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:34 AM |
| vle the problem is that the output window is asking that i need to put and interval in the argument which is (1,#teles) which is need to know how to put and interval there.... |
|
|
| Report Abuse |
|
|
| |
|
CrniOrao
|
  |
| Joined: 12 Oct 2008 |
| Total Posts: 2274 |
|
|
| 22 Dec 2013 08:46 AM |
Isn't it supposed to be just this?
tele = math.random(1, #teles) |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:49 AM |
teles = {} for nuum, obbj in pairs(cc) do if team == 1 then if obbj.Name == "RedTele" then table.insert (teles, obbj) end elseif team == 2 then if obbj.Name == "BlueTele" then table.insert (teles, obbj) end end wait() end ================================================================================== I guess this is the table part |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 08:53 AM |
| Crni I tried dat but it just says the same that it need na interval..... |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Dec 2013 09:16 AM |
shouldn't it be a table with the locations and math.random of the table? |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 11:15 AM |
| Duel it is not the table which is the problem it is that i need an interval in the(1,#teles) part and can anybody at all help me? |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Dec 2013 12:19 PM |
| Can anybody else help... I am really stuck? If you dont know any suggestions on how to get the interval in (1,#teles).... |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 22 Dec 2013 12:23 PM |
Are you sure its referring to that math.random and not, say the math.random(x1, x2) or math.random(z1, z2) ? Because in that case, z1, z2, x1, x2 can be decimals, which can cause problems for the math.random... |
|
|
| Report Abuse |
|
|
|
| 22 Dec 2013 03:41 PM |
| I have no idea what your saying but it definatly says on that line and it says tele = teles[math.random(1,#teles)] -- this is a bad argument (no interval).... |
|
|
| Report Abuse |
|
|
| |
|
|
| 22 Dec 2013 04:07 PM |
| All I need to know is how do I add the interval in the (1,#teles) |
|
|
| Report Abuse |
|
|
wazap
|
  |
| Joined: 29 Jun 2007 |
| Total Posts: 23234 |
|
|
| 22 Dec 2013 05:40 PM |
| Its possible that teles is an empty table at this point. |
|
|
| Report Abuse |
|
|
|
| 23 Dec 2013 01:48 AM |
| No I am pretty sure that the problem is and interval at the (1,#teles) part the table works fine... this aint my script but when I ran it before it had no problems it probably just the interval.... Still waiting for ideas or suggestions on what I should do |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
| |
|
|
| 23 Dec 2013 01:54 AM |
| Oh so if I put that then the output should have no problems...? |
|
|
| Report Abuse |
|
|