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: How do you apply this to all children?

Previous Thread :: Next Thread 
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
03 Mar 2014 08:37 AM
There's a platform with multiple parts. If you touch one, this happens:

function onTech(Hit)
if not debounce then debounce = true
for I = .5,0,-0.01 do
script.Parent.Transparency = I
wait(0.05)
end
debounce = false
end
end

script.Parent.Touched:connect(onTech)

I'd want it to be though, if you touch one, the script applies to all the parts of a model (script.Parent.Parent.(all children)
Report Abuse
ProjectNumberZero is not online. ProjectNumberZero
Joined: 14 Feb 2014
Total Posts: 651
03 Mar 2014 09:57 AM
use some sort of for loop to search for all children of script.Parent.Parent
Report Abuse
Bebee2 is not online. Bebee2
Joined: 17 May 2009
Total Posts: 3985
03 Mar 2014 10:02 AM
There's a platform with multiple parts. If you touch one, this happens:

function onTech(Hit)
if not debounce then debounce = true
for I = .5,0,-0.01 do
script.Parent.Transparency = I -- Do you still want this part?
for _,v in pairs(script.Parent.Parent:GetChildren()) do
if v:IsA'BasePart' then
v.Transparency = I
end
end
wait(0.05)
end
debounce = false
end
end

script.Parent.Touched:connect(onTech)

Report Abuse
KodakKid3 is not online. KodakKid3
Joined: 25 Dec 2008
Total Posts: 2860
03 Mar 2014 07:27 PM
Awesome, thank you.
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