Hello, i'm making a script for a door that when i click it, the PrimaryPart of the door rotates so the door "opens", but i'm not really used with radians and all that so now when i click it, the door goes open at 90 degress then when i try to close it i goes around the other way and i dont know how to fix that, any help is welcome!
if touch == false and db == false then touch = true db = true door.PrimaryPart = door.Middle local dpos = door.PrimaryPart.Position door:SetPrimaryPartCFrame(CFrame.new(door.PrimaryPart.Position)* CFrame.Angles(0,door.PrimaryPart.Rotation.y+math.rad(90),0)) wait(.5) db = false elseif touch == true and db == false then touch = false db = true door.PrimaryPart = door.Middle local dpos = door.PrimaryPart.Position door:SetPrimaryPartCFrame(CFrame.new(door.PrimaryPart.Position)* CFrame.Angles(0,door.PrimaryPart.Rotation.y-math.rad(90),0)) wait(.5) db = false end