I have, in StarterGui, a ScreenGui then a frame, in the frame is a textbutton, and in the button there's a localscript that should change the camera lock mode to the opposite (eg, if in 3rd person it changes to first, and if in 1st person it changes to third)
I know that this can be changed as easy as scrolling your mouse, but I want a feature in my game more or less to just fill a space so my OCD doesn't drive me crazy. Here is the content in the localscript.
--script by OpticUniversse, with help by _____ (insert your name here for credit)
if LocalPlayer.CameraMode = Enum.Cameramode.ThirdPerson then
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
else if LocalPlayer.CameraMode = Enum.Cameramode.FirstPerson then
game.Players.LocalPlayer.CameraMode = Enum.CameraMode.LockThirdPerson
end
However, it doesn't seem to work. I'm not very good at this, so if anyone wants to give me some pointers on how to fix it, I'd appreciate it very much. Thanks!

2 comments
Can you check if this code is ran by adding prints into each logic choice
Use leif not else if.