1

# The following "First Person Only" script does not work. [SOLVED] [closed]

This script, when placed in a Script and then placed in ServerScriptService does not work. I am confused whether or not I need a LocalScript and where it should be going. If this is the correct place/object, what is wrong with the script? I would like it to force the player into 1st person but not by using a GUI that blocks view when zooming out.

while true do
game:GetService('Players').LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
wait(10)
end


### Locked by TheMyrco

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

2
nate890 495
7 years ago

As stated by Fattycat, it should indeed be ran through a localscript, otherwise it will only work in solo mode. However, earlier I was playing with CameraMode (see this thread) and came across a very unique problem- the CameraMode didn't want to change when the code was ran for the second time (only successfully changing the CameraMode when the player joined, not upon reset.)

This being said, there is a solution to this rather annoying CameraMode issue, and the solution was posted on the thread that I linked earler (it's the last post on the thread.) The solution is to simply change the CameraMode value to "Classic" and then to "LockFirstPerson."

If you want to force first person upon entering and resetting, put the following code in a LocalScript and insert the LocalScript into game.StarterPack or game.StarterGui.

local player = game.Players.LocalPlayer

player.CameraMode = Enum.CameraMode.Classic
wait() -- I don't know if this wait is needed, I haven't tested it, but the person who supplied a solution included a wait (again, see the link posted earlier in this answer)
player.CameraMode = Enum.CameraMode.LockFirstPerson


0
Unfortunately, this script did not seem to work. Tried with the local script in both starterpack and startergui, but it did not make any difference. Corogl 0 — 7y
0
Try it now nate890 495 — 7y
1
It works beautifully! Thank you so very much! Corogl 0 — 7y
2
MunimR 125
7 years ago

Make sure you put this in a Local Script, since you reference "LocalPlayer" and place into the Player somehow (Easiest method is StarterGui)