I have been trying to make my own CFrame swing doors lately, and I've been running into some problems, like the door swings open, but it doesn't swing back in the right way, is there a way to calculate the correct numbers and angles to put into the CFrames? If not, can you at least answer with some tips on how to make the CFrames work right? Here's what I've got:
local Door = script.Parent
local DoorFrame = Door.Parent
local CD1 = Door.CD
--I am still not sure about the numbers in here, the dimensions of the door are (4, 6, 0.4)
function Open1()
if Door.InUse.Value then
Door.InUse.Value = true
for i = 1, 18 do
Door.CFrame = Door.CFrame * CFrame.new(0, 0, 0.21) * CFrame.fromEulerAnglesXYZ(0, 0.1, 0)
wait(0.01)
end
wait(1.5)
for i = 1, 18 do
Door.CFrame = Door.CFrame * CFrame.new(0.002, 0, -0.22) * CFrame.fromEulerAnglesXYZ(0, -0.1, 0)
wait(0.01)
end
Door.InUse.Value = false
end
end
CD1.MouseClick:connect(Open1)

5 comments
Post what you have.
The script?
Yep.
I have no idea what I'm doing, as I'm new here... but there it is!
AHA, finally found out what code break does!