Limit the player's wide view

Hello,

Lately I’ve been thinking about how to make a system that manages to make the player look only to the sides and to the front and it’s not possible to rotate the camera 360 degrees, making it in first person as if it were in real life, in real life we ​​can’t look backwards unless we rotate our body, I want to try to do something related to that

Of course, to do this we would have to do something related to trying to activate this function and deactivate this function at the time we want, to make our player not able to look and walk backwards, and to make it activated in unique moments.

just use

--local script
local player = game.Players.LocalPlayer

local function firstperson()
	player.CameraMode = 1 -- LockFirstPerson 1 Exclusively first-person camera.
end

and