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 » Scripters
Home Search
 

Re: How could I add more parts to the selection?

Previous Thread :: Next Thread 
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:03 PM
door = script.Parent.Parent.Door
door1 = script.Parent.Parent.Door1
ON = script.Parent.Parent.ON

function onClicked(mouse)
if ON.Value == 0 then
door.Transparency = 0
door.CanCollide = true
door1.Transparency = 1
door1.CanCollide = false
door1.Hotch:play()
ON.Value = 1
else
door1.Transparency = 0
door1.CanCollide = true
door.Transparency = 1
door.CanCollide = false
door1.Hotch:play()
ON.Value = 0
end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

--

How could I have the script recognize a group(full of multiple parts) as something like "door" instead of one part as "door" So I can use more than two parts for this door script, could some one help me?

[So when you activate the "button" instead of one part dissapearing and another one appearing. Instead a whole group of parts dissapear and a whole other group of parts appear]
Report Abuse
Rocky28447 is online. Rocky28447
Joined: 11 Dec 2009
Total Posts: 2912
15 Feb 2016 07:08 PM
getchildren and for loops



choo choo
Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:10 PM
I don't know how to script(very well), could you show me an example of where (and what) I should type into the script?
Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:21 PM
bump
Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:29 PM
bymp
Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:44 PM
Understanding and having absolute knowledge are two different things believe it or not.

If I say, can some one help me get my rocket into space?

and only get a reply of

"Oh yeah sure, Just use "rocket-fuel" and "aerodynamics".

I understand what those are, but not giving me instruction "or even better an example!"
is worse for me than having not asked for help because now I am wasting time typing a salty response. Time that could have been spent trying to figure out my problem by myself as usual, and then giving up two hours and sixteen minutes later because I don't know what the hell I am supposed to code or type.
Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 07:48 PM
I'm going to eat leftover Chinese food and wallow in my depression now.
Report Abuse
gamehero is not online. gamehero
Joined: 12 Jun 2007
Total Posts: 1455
15 Feb 2016 08:58 PM
If "Door" and "Door1" is a model or a folder, use this.

for i,part in pairs(script.Parent.Parent.Door:GetChildren()) do
part.Transparency = 1
part.CanCollide = false
end

for i,part in pairs(script.Parent.Parent.Door1:GetChildren()) do
part.Transparency = 0
part.CanCollide = true
end


Report Abuse
CostumeBlitz is not online. CostumeBlitz
Joined: 22 Feb 2010
Total Posts: 381
15 Feb 2016 09:52 PM
ON = script.Parent.Parent.ON
Sund = script.Parent.Parent.Door1.Gear

function onClicked(mouse)
if ON.Value == 0 then
for i,part1 in pairs(script.Parent.Parent.Door1:GetChildren()) do
part1.Transparency = 1
part1.CanCollide = false
end
for i,part1 in pairs(script.Parent.Parent.Door:GetChildren()) do
part1.Transparency = 0
part1.CanCollide = true
end
Sund.Hotch:play()
ON.Value = 1

else

for i,part1 in pairs(script.Parent.Parent.Door1:GetChildren()) do
part1.Transparency = 0
part1.CanCollide = true
end
for i,part1 in pairs(script.Parent.Parent.Door:GetChildren()) do
part1.Transparency = 1
part1.CanCollide = false
end
Sund.Hotch:play()
ON.Value = 0

end
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)

--
Thank you Gamehero.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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