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: Is there a way to shorten this code?:

Previous Thread :: Next Thread 
Xopic is not online. Xopic
Joined: 02 Jan 2013
Total Posts: 3183
17 Jun 2014 02:22 PM
script.Parent.Parent.Parent.Parent.Doors.Door1.d1 = false
script.Parent.Parent.Parent.Parent.Doors.Door1.d2 = false
script.Parent.Parent.Parent.Parent.Doors.Door1.d3 = false
script.Parent.Parent.Parent.Parent.Doors.Door1.d4 = false
script.Parent.Parent.Parent.Parent.Doors.Door1.d5 = false
script.Parent.Parent.Parent.Parent.Doors.Door1.d6 = false
Report Abuse
Xopic is not online. Xopic
Joined: 02 Jan 2013
Total Posts: 3183
17 Jun 2014 02:23 PM
I forgot the "CanCollide" bit after the d1 and all that but the title xP
Report Abuse
sonicdiablo is not online. sonicdiablo
Joined: 05 Feb 2009
Total Posts: 1661
17 Jun 2014 02:24 PM
Doors = script.Parent.Parent.Parent.Parent.Doors
Doors.Door1.d1 = false
Doors.Door1.d2 = false
Doors.Door1.d3 = false
Doors.Door1.d4 = false
Doors.Door1.d5 = false
Doors.Door1.d6 = false

Or you could use a for loop with :GetChildren, but you only have 6 doors.
Report Abuse
marioblox1094 is not online. marioblox1094
Joined: 14 Aug 2010
Total Posts: 1839
17 Jun 2014 02:26 PM
for i = 1,6 do
script.Parent.Parent.Parent.Parent.Doors.Door1["d".. i].CanCollide = false
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