Open door button script not working. Any help? (This button is for a rank+ only.)
Asked by
5 years ago Edited 5 years ago
01 | local ClickDetector = script.Parent.ClickDetector |
03 | LGate 2 = script.Parent.LGate 2 |
04 | RGate 2 = script.Parent.RGate 2 |
07 | ClickDetector.MouseClick:Connect( function (player) |
08 | if player:GetRankInGroup( 4853203 ) > = 10 then |
09 | script.Parent.ClickDetector.MouseClick:Connect( function () |
12 | for C = 1 , Increment do |
14 | LGate 2. PrimaryPart = LGate 2. hinge |
15 | RGate 2. PrimaryPart = RGate 2. hinge |
16 | LGate 2 :SetPrimaryPartCFrame(LGate 2. PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ( 0 ,math.rad(- 110 /Increment), 0 )) |
17 | RGate 2 :SetPrimaryPartCFrame(RGate 2. PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ( 0 ,math.rad( 110 /Increment), 0 )) |
19 | elseif open = = true then |
21 | for C = 1 , Increment do |
23 | LGate 2. PrimaryPart = LGate 2. hinge |
24 | RGate 2. PrimaryPart = RGate 2. hinge |
25 | LGate 2 :SetPrimaryPartCFrame(LGate 2. PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ( 0 ,math.rad( 110 /Increment), 0 )) |
26 | RGate 2 :SetPrimaryPartCFrame(RGate 2. PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ( 0 ,math.rad(- 110 /Increment), 0 )) |
My script to open a door isn't working. This is where everything is located: https://prnt.sc/r9rgvp
There are two doors with 1 script each. I have a left and a right door.