btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
|
| 14 Apr 2013 10:51 AM |
Its supposed to clone a random one, per go. this is in a _G function, and is called in a wait(30) loop. in another script.
for i = 1, 1 do Game.Lighting.fabs:GetChildren()[math.random(1, #Game.Workspace.Eggs:GetChildren())]:Clone().Parent = Game.Workspace.Eggs |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 10:52 AM |
there's no end and why would you do for i=1, 1 do? that's throwing the point of a loop out the window |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
|
| 14 Apr 2013 10:52 AM |
| And, when I look in 'fabs' children, that 1 egg is the 1st one. |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
|
| 14 Apr 2013 10:52 AM |
| @Un, I tried it without a loop, too. That was my last resort. |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
|
| 14 Apr 2013 12:19 PM |
| bump for someone who can help |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 14 Apr 2013 12:35 PM |
Try instead:
local num = math.random(1, 3) --or whatever number while true do if num == 1 then NAMEHERE:clone().Parent = game.Workspace elseif num == 2 then NAMEHERE:clone().Parent = game.Workspace elseif num == 3 then NAMEHERE:clone().Parent = game.Workspace wait(300) end end
|
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 12:57 PM |
^^WHY You can do it so much easier... |
|
|
| Report Abuse |
|
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 14 Apr 2013 12:58 PM |
| Well, maybe you should give it to him? Maybe give the easier way? |
|
|
| Report Abuse |
|
|
|
| 14 Apr 2013 01:03 PM |
| The way he's doing it is fine...i'm not sure why it's not working. |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
ForceSky
|
  |
| Joined: 30 Jul 2012 |
| Total Posts: 2379 |
|
|
| 14 Apr 2013 06:01 PM |
| btft just use mine, I have no idea why yours isn't working. |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
|
| 14 Apr 2013 09:04 PM |
fabs = Game.Lighting.fabs:GetChildren()
for _,v in pairs(fabs) do if fabs == v then fabs(math.random(1, #game.Workspace.Eggs:GetChildren())):clone().Parent = Game.Workspace.Eggs -- I don't know why .Eggs but it's what you want lol end end
~ Make the simple, amazing ~ |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
|
| 14 Apr 2013 09:46 PM |
| Idk know what you were trying to do so i can't help more than that.. And what did the ouput give? |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
|
| 14 Apr 2013 10:23 PM |
| Im going to keep trying :D |
|
|
| Report Abuse |
|
|
btft
|
  |
| Joined: 19 Feb 2011 |
| Total Posts: 1512 |
|
| |
|
getkoed2
|
  |
| Joined: 11 Apr 2010 |
| Total Posts: 1144 |
|
|
| 15 Apr 2013 04:08 PM |
local loleggs = workspace.Eggs local lolfabs = game.Lighting.fabs
local lolchildren = lolfabs:GetChildren() lolchildren[math.random(1, #lolfabs:GetChildren())]:clone().Parent = loleggs |
|
|
| Report Abuse |
|
|