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: Teach me about GetChildren()

Previous Thread :: Next Thread 
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:06 PM
How does it work? If it's too complicated, just say so. I don't know much about it.
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:06 PM
[ Content Deleted ]
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:11 PM
Ok... So how would you use GetChildren() to find... say... all the yellow bricks in Workspace, and turn them green?
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:13 PM
[ Content Deleted ]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Mar 2012 09:14 PM
Incorporating that with a for loop:

for i, v in pairs(game.Workspace:GetChildren()) do
if v.BrickColor == BrickColor.new("Bright yellow") then
v.BrickColor = BrickColor.new("Bright green")
end
end)

† KMXD †
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:15 PM
[ Content Deleted ]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Mar 2012 09:15 PM
Oops, the parenthesis is not supposed to be there. :U

Just use Banana's script.

† KMXD †
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:15 PM
... o.o WUT!?

What it 'i,v' and 'in pairs', I'm assuming v is the variable that stands for the 'Children' in Workspace... Right? But what is 'i' in front of the ',v' and... and... and... *faints from mental exhaustion*
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Mar 2012 09:16 PM
I meant Val, lol.

Yes, I know now, but you mean change color, not remove?


† KMXD †
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:19 PM
[ Content Deleted ]
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:20 PM
-.- *just revived* I just wanted to learn about GetChildren() and maybe for loops :/ I didn't want some debate or w/e...
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:22 PM
I am EXTREMELY new to Lua. Do you think you could dumb that explanation up?

'for i,v in pairs(mytable) do
print(tostring(i).." : "..v)
end'

What is tostring and... why the (i).." : "..v) ?
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:24 PM
[ Content Deleted ]
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:27 PM
Nevermind. You may think I'm stupid, but that was still way over my head. I need to do some learning. :/
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:29 PM
[ Content Deleted ]
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:30 PM
Hmm... Hey... I know you're a new user and all, so you might not know the jetpack script (you can search it in free models) but could you take a look at my thread "I seriously need SOMEONE to respond with some help!"? No one has been helpful :/ You too Knightmare? :D
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:31 PM
[ Content Deleted ]
Report Abuse
KnightmareXD is not online. KnightmareXD
Joined: 14 Jul 2009
Total Posts: 11189
28 Mar 2012 09:32 PM
@Val

I could definitely tell... :P

† KMXD †
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:32 PM
@Valaxia... That sounded kinda condescending :( W/e... You're right though. It's just I try the ROBLOX wiki and stuff and they go straight from explaining layers of the game like game>Workspace>MattJon>Head etc. into scripting stuff I can't understand :/
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:33 PM
It said you joined yesterday... :/ March 27, 2012... ?
Report Abuse
Valaxia is not online. Valaxia
Joined: 27 Mar 2012
Total Posts: 73
28 Mar 2012 09:35 PM
[ Content Deleted ]
Report Abuse
MattJon is not online. MattJon
Joined: 28 Apr 2009
Total Posts: 660
28 Mar 2012 09:37 PM
Ah... BTW I responded on my other thread...
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