How do I make this go back after it goes to the last rotations which is 90? Like I want it where the x value for the rotation stops there and when I click it again, it goes backward. This is the script of BlueTaslem:

--BlueTaslem Answered Script (Thank you)
local cover = game.Workspace.Radio.Cover
local home = cover.CFrame

function onClicked()
for t = 0, 4.8, 0.03 do
    wait(0.001)
    local v = math.cos(t / 4.8 * math.pi) * 45 + 90 + 45
    cover.CFrame = home
    cover.Rotation = Vector3.new(v, 0, 180)
end
end

script.Parent.ClickDetector.MouseClick:connect(onClicked)