Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

2 Price Is Right doors need to be combined?

Asked by 10 years ago

I have two doors, each with 8 panels. The first door opens halfway, for host entry. The second door opens fully, to present a prize. Each door has 4 separate scripts, controlling 2 panels.

Here is what I have so far:

Door 1, Panel set 1 (This is repeated to the other panel sets with different timings and different names):

01DoorParts=script.Parent.DoorParts1
02open=0
03function onClick()
04    if open==0 then
05    open= 1
06 
07        for i=1,30 do
08        wait(.02)
09        DoorParts.B1.CFrame=DoorParts.B1.CFrame*CFrame.new(.15,0,0)
10        DoorParts.B2.CFrame=DoorParts.B2.CFrame*CFrame.new(-.15,0,0)
11 
12 
13        end
14    --Gate is turned off
15 
View all 35 lines...

Door 2:

01DoorParts=script.Parent.DoorParts1
02open=0
03function onClick()
04    if open==0 then
05    open= 0
06 
07        for i=1,30 do
08        wait(.02)
09        DoorParts.B1.CFrame=DoorParts.B1.CFrame*CFrame.new(.4,0,0)
10        DoorParts.B2.CFrame=DoorParts.B2.CFrame*CFrame.new(-.4,0,0)
11 
12 
13        end
14    --Gate is turned off
15 
View all 35 lines...

I need help fusing these two together, so I can have two buttons on one door, one opening halfway, and one opening fully.

Answer this question