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: Question / Help

Previous Thread :: Next Thread 
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
23 Apr 2014 08:59 PM
So I have a gate model, I want to make it open and close. Each brick is named Part. How would I set it so it Gets all the children and set their transparency to 1

Would it be something like

Gate1 = game.Workspace.Gate:GetChildren()

Gate1.Transparency = 1

I doubt thats correct but.
Report Abuse
eggsofdeath is not online. eggsofdeath
Joined: 07 Jan 2009
Total Posts: 5085
23 Apr 2014 09:03 PM
this is probably a decently bad way, but it works:
name each part something like part1, part2, and put the script in the gate group

script.Parent.Part1.Transparency = 1
script.Parent.Part2.Transparency = 1
script.Parent.Part3.Transparency = 1
script.Parent.Part4.Transparency = 1
-- (etc, etc)

end

Report Abuse
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
23 Apr 2014 09:24 PM
I don't want to do that, Theres a TON of blocks in my gate, I need it so it gets all the children and turns their transparency to 1
Report Abuse
magoo8 is not online. magoo8
Joined: 25 Apr 2009
Total Posts: 1122
23 Apr 2014 09:41 PM
Function onClick()
Gate = script.Parent:clone()
Gate.parent = game.Lighting
Gate.name = "gate"
Gatescript = script:clone()
Gatescript.Parent = game.Lighting.gate
Script.Parent:remove()
Wait(5)
Gate.parent = game.Workspace

End

Script.Parent.MouseButton1Clicked:connect(onClick)

--idk if that would work, maybe
Report Abuse
SuperSniper222 is not online. SuperSniper222
Joined: 09 Jul 2010
Total Posts: 426
23 Apr 2014 09:55 PM
That won't work due to when I try, it does not move back to its original spot. Maybe because its a CFramed gate.
Report Abuse
Imacheeseburger is not online. Imacheeseburger
Joined: 16 Jun 2011
Total Posts: 142
23 Apr 2014 10:00 PM
for i,v in pairs(Gate:GetChildren()) do
if v.Name=="Part" then
v.Transparency=1
wait(5)
v.Transparency=0
end
end
Report Abuse
warspyking is not online. warspyking
Joined: 15 Nov 2011
Total Posts: 13947
23 Apr 2014 10:37 PM
@above that would indivually work on each brick every 5 seconds -_-

for I = 1,2 do
for _,v in ipairs(Gate1) do
if v.Transparency == 0 then
v.Transparency = 1
else
v.Transparency = 0
end
if v.CanCollide == true then
v.CanCollide = false
else
v.CanCollide = true
end
end
wait(5)
end
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