Why does the door turn? How to make so that she not turn?
deboulse = false
script.Parent.Button.ClickDetector.MouseClick:connect(function(player)
if deboulse == false then
deboulse = 2
print(player.Name.." open door")
for i = 0,005 do
script.Parent.Parts.Union1.CFrame = script.Parent.Parts.Union1.CFrame*CFrame.new(0,0,3)
script.Parent.Parts.Union2.CFrame = script.Parent.Parts.Union1.CFrame*CFrame.new(0,0,3)
script.Parent.Parts.Part1.CFrame = script.Parent.Parts.Union1.CFrame*CFrame.new(0,0,3)
script.Parent.Parts.Part2.CFrame = script.Parent.Parts.Union1.CFrame*CFrame.new(0,0,3)
wait()
end
for index, light in pairs(script.Parent.lights:GetChildren()) do
light.Color = Color3.new(1,0,0)
end
script.Parent.lights.BrickColor = BrickColor.new("Bright red")
deboulse = true
elseif deboulse == true then
deboulse = 2
print(player.Name.." close door")
for i = 0,005 do
script.Parent.Parts.Union1.CFrame = script.Parent.Parts.Union1.CFrame+Vector3.new(0,0,3)
script.Parent.Parts.Union2.CFrame = script.Parent.Parts.Union1.CFrame+Vector3.new(0,0,3)
script.Parent.Parts.Part1.CFrame = script.Parent.Parts.Union1.CFrame+Vector3.new(0,0,3)
script.Parent.Parts.Part2.CFrame = script.Parent.Parts.Union1.CFrame+Vector3.new(0,0,3)
wait()
end
for index, light in pairs(script.Parent.lights:GetChildren()) do
light.Color = Color3.new(1,1,1)
end
script.Parent.lights.BrickColor = BrickColor.new("Institutional white")
deboulse = false
end
end)

1 comment
Have you tried using a HingeConstraint to make your door close? http://wiki.roblox.com/index.php?title=API:Class/HingeConstraint