CFrame Rotation

This is the Renderstepped part that makes the magic happen.

This is the input began, whereby a key gets pressed

This is the inputended, whereby the key is released

Now what I want it to do is that when the key is pressed, the object starts rotation, but when the key is released, it stops at its current location.
What it’s doing instead is this:
https://gyazo.com/a7a6724850d36b1a0cf206dd5d99d1f0

Even when I release the key, it keeps rotating.
I don’t really understand where I went wrong.

Notice - All the variables, InputBegan and InputEnded functions are correct and properly linked with UserInputService.

Move RRS:Wait() after the print statements. This may cause the issue because the rotation is being set the next frame after a key is pressed, and one frame after it is released. Since it is set to no rotation in the same frame the key is released, the rotation gets re-applied the very next frame.