game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson if unlock == true then game.Players.LocalPlayer.CameraMode = Enum.CameraMode.Classic end)
Altough when testing, the property did change to Classic, but the mouse is still stuck at the middle, not moveable.
GUI buttons have a field known as "Modal" that, when true, will unlock the mouse in first person as long as that button has its "Visible" field set to true.
I would set it manually in Studio, then you will not have any problems.
Remember to accept the answer if is it helpful for you! I'm glad to help :)
Pretty simple, just simply set workspace.CurrentCamera.CameraType = Enum.CameraType.Scriptable
and good to go :)