Camera rotation limit relative to HumanoidRootPart in @DuruTeru camera script

Hi
While looking at a script on a camera it became interesting to limit its rotation
I found a possible solution, it is :Dot() LookVector camera’s and HumanoidRootPart
But I don’t quite understand how to limit it, since it’s just a check:

if Dot < 0 then

    --> Code

end

It’s like the camera just gets stuck, it doesn’t look good:

So how do I make a limit?
The camera script is based on @DuruTeru’s script