if game.Players.LocalPlayer.Character.Humanoid.Health >= 1 then -- prevents glitching when equipping gun after death
script.Parent.Parent:WaitForChild('Humanoid').CameraOffset = Vector3.new(camx, camy, camz)
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
-- blah blah extra code thats not relevant
Ive seen other ways to do this but none had the camera locked nor were implemented how I am trying to do so here, any help is greatly appreciated, thanks.