generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Hmm, this is cloning the same one, when,

Previous Thread :: Next Thread 
btft is not online. 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
Unsubstantial is not online. Unsubstantial
Joined: 11 Sep 2012
Total Posts: 872
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 is not online. 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 is not online. 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 is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 11:49 AM
eaaaa
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 12:19 PM
bump for someone who can help
Report Abuse
ForceSky is not online. 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
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
14 Apr 2013 12:57 PM
^^WHY
You can do it so much easier...
Report Abuse
ForceSky is not online. 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
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
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 is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 02:21 PM
Bump
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 02:29 PM
Ploxx
Report Abuse
ForceSky is not online. 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 is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 08:58 PM
nuuu
Report Abuse
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
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 is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 09:35 PM
NOP
Report Abuse
coolikevin22 is not online. coolikevin22
Joined: 21 Feb 2011
Total Posts: 450
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 is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
14 Apr 2013 10:23 PM
Im going to keep trying :D
Report Abuse
btft is not online. btft
Joined: 19 Feb 2011
Total Posts: 1512
15 Apr 2013 03:35 PM
help
Report Abuse
getkoed2 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image