How do I write a script that when I hold shift the character unlocks and when I release shift it comes back smoother

How do I make a script that looks like the movement in the game The Wild West, when I hold shift the character unlocks and when I release shift the character returns (if possible, make him return slowly)

What I got was this:

local uis = game:GetService(“UserInputService”)
local uis = UserSettings():GetService(“UserGameSettings”)

uis.InputBegan:Connect(function(input)
if input.UserInputType == Enum.KeyCode.LeftShift then
uis.RotationType = Enum.RotationType.MovementRelative
end
end)

uis.InputEnded:Connect(function(input)
if input.KeyCode == Enum.KeyCode.LeftShift then
uis.RotationType = Enum.RotationType.CameraRelative

end

end)

But it returns instantly

A reference video for me to show what I want: