local ClickDetector = script.Parent.ClickDetector open = false LGate2 = script.Parent.LGate2 RGate2 = script.Parent.RGate2 Increment = 180 ClickDetector.MouseClick:Connect(function (player) if player:GetRankInGroup(4853203) >= 10 then script.Parent.ClickDetector.MouseClick:Connect(function() if open == false then open = true for C = 1, Increment do wait() LGate2.PrimaryPart = LGate2.hinge RGate2.PrimaryPart = RGate2.hinge LGate2:SetPrimaryPartCFrame(LGate2.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(-110/Increment),0)) RGate2:SetPrimaryPartCFrame(RGate2.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(110/Increment),0)) end elseif open == true then open = false for C = 1, Increment do wait() LGate2.PrimaryPart = LGate2.hinge RGate2.PrimaryPart = RGate2.hinge LGate2:SetPrimaryPartCFrame(LGate2.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(110/Increment),0)) RGate2:SetPrimaryPartCFrame(RGate2.PrimaryPart.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(-110/Increment),0)) end end end) end end)
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.
On line 3 and 4 you said script.Parent.LGate2
and script.Parent.RGate2
and script.Parent
is RemotePadInterview
and RemotePadTraining
Replace script.Parent
with script.Parent.Parent
local ClickDetector = script.Parent.ClickDetector open = false LGate2 = script.Parent.Parent.LGate2 RGate2 = script.Parent.Parent.RGate2 Increment = 180 -- Other code here...