of     1   

Pyskshi
#227760088Monday, November 20, 2017 10:47 AM GMT

Greetings, I have been trying to script a door for my Aircraft Hangar and the door is a model that includes a button. Inside the button is a ClickDetector, I have inserted a script into the ClickDetector and have typed: script.Parent.MouseClick:connect(function() door1 = script.Parent.Parent.Parent.Door1:GetChildren() door2 = script.Parent.Parent.Parent.Door2:GetChildren() door1.Transparency=1 door1.CanCollide= false door2.Transparency=1 door2.CanCollide= false end) I am trying to script it so when I click the button both door models change transparent and CanCollide equals false. Thanks for the help. -Kind Regards pyskshi
Voxxie
#227760138Monday, November 20, 2017 10:52 AM GMT

door1 = script.Parent.Parent.Parent.Door1 door2 = script.Parent.Parent.Parent.Door2 script.Parent.MouseClick:Connect(function() for i,v in pairs(door1:GetChildren()) do v.Transparency = 1 v.CanCollide = false end for i,v in pairs(door2:GetChildren()) do v.Transparency = 1 v.CanCollide = false end end)
balcktack
#227760147Monday, November 20, 2017 10:53 AM GMT

is there other stuff in the doors for example a int value or something that dose not have the can collide or the transparency, if there is this script should do it. script.Parent.MouseClick:connect(function() door1 = script.Parent.Parent.Parent.Door1:GetChildren() door2 = script.Parent.Parent.Parent.Door2:GetChildren() for _, child1 in pairs(door1) do if ################ == 'Part' or ################ ## ####### then child1.Transparency = 1 child1.CanCollide = false end end for _, child2 in pairs(door2) do if ################ == 'Part' or ################ ## ####### then child2.Transparency = 1 child2.CanCollide = false end end end)
balcktack
#227760152Monday, November 20, 2017 10:54 AM GMT

script.Parent.MouseClick:connect(function() door1 = script.Parent.Parent.Parent.Door1:GetChildren() door2 = script.Parent.Parent.Parent.Door2:GetChildren() for _, child1 in pairs(door1) do if ################ == 'Part' or ################ ## ####### then child1.Transparency = 1 child1.CanCollide = false end end for _, child2 in pairs(door2) do if ################ == 'Part' or ################ ## ####### then child2.Transparency = 1 child2.CanCollide = false end end end)
Pyskshi
#227760405Monday, November 20, 2017 11:22 AM GMT

Thanks, testing that out now.
Pyskshi
#227760427Monday, November 20, 2017 11:24 AM GMT

Voxxie's script has worked, thanks Voxxie and balcktack c:

    of     1