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
 

getchildren ()

Previous Thread :: Next Thread 
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
23 Nov 2013 06:26 PM
Just wanna quickly review the topic.

tell me if im right for both

all = game.Workspace.Brick:GetChildren()
all.Transparency = 1

Do you have to make a loop?

all = game.Workspace.Brick:GetChildren()
for i = 1, #all do
all[i].Transparency = 1
end


could I do this?

while true do
all = game.Workspace.Brick:GetChildren()
for i = 1, #all do
all[i].Transparency = 1
end
end

Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
23 Nov 2013 06:31 PM
Help!
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
23 Nov 2013 06:40 PM
You don't need a while-loop, but you do need the in pairs (or in next) iterator.

If you want to make all parts under Workspace.Brick transparent:

for i, v in next, Workspace.Brick:GetChildren() do
if v:IsA("BasePart") then -- Important to prevent common errors
v.Transparency = 0
end -- endif
end -- endfor
Report Abuse
notsopwnedg is not online. notsopwnedg
Joined: 07 Nov 2010
Total Posts: 4182
23 Nov 2013 06:42 PM
@XAX His numeric for loop should work fine. If he prefers that to iterators then let it be. Using an iterator with a for loop is not needed.
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
23 Nov 2013 06:55 PM
I suppose. My main concern was the while loop in the beginning. It was unnecessary, and would crash the client since there's no wait() anywhere in it.
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
23 Nov 2013 09:33 PM
Wut if I want it to run an infinite amount?
Report Abuse
XAXA is not online. XAXA
Joined: 10 Aug 2008
Total Posts: 6315
23 Nov 2013 09:51 PM
After you change the transparency of the parts to 1, it will remain invisible indefinitely.

Do you want it to blink?
Report Abuse
KEVEKEV77 is not online. KEVEKEV77
Joined: 12 Mar 2009
Total Posts: 6961
23 Nov 2013 09:53 PM
I just want to know if u can make it run infinetely.
I could easily make this blink.....
But I was wondering how to make it infinite
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