Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I keep players in 1st person?

Where it is zoomed all the way in and stays there.

Examples: Murder/Murder Mystery

6 answers

Incorrect to all, I REALLY RECOMMEND that:

  1. FIRST, put a script into the StarterPack in the studio then, Paste this into the script!:

while true do wait(0.5) script.Parent.Parent.CameraMode = "LockFirstPerson" end

1 comment

0

IT HAS TO BE A LOCALSCRIPT

game.Players.reaper5.CameraMode = 1

If you found this useful please choose it as the correct answer.

1 comment

0

That was a fast answer, and thank you, I will try it.

@reaper5 just wow

That is working, it has been tested!

How do you think that this code WILL work on every PLAYER!

Create a localscript and put it into the StarterGui, we will now get the player:

local player = game.Players.LocalPlayer

Now we need to LOCK the player in FPS Mode

local player = game.Players.LocalPlayer
player.CameraMode = Enum.CameraMode.LockFirstPerson
player.Camera.FieldOfView = 55 -- Or change your FOV

That's it and reaper5 stop.

2 comments

0

Okay, i'll try this also :P

0

This one works

Whenever a player enters your game(after he/she's load) he goes into 1stPerson Only.

game.Players.PlayerAdded:connect(function(player)
	if player:WaitForDataReady() then
		player.CameraMode = "LockFirstPerson"
	end
end)

Try this, it is easier to munipulate it when say a map ends or your character dies. It must be in a local script.

--_G.FirstPersonEnabled should be modified through your main script, that way people aren't always stuck in First Person Mode.

repeat wait() until _G.FirstPersonEnabled==true
while wait() do
	if _G.FirstPersonEnabled == true and script.Parent.Parent.Character.Humanoid.Health~=0 then
		script.Parent.Parent.CameraMode = 1
	else
		script.Parent.Parent.CameraMode = 0
	end
end

--Look, you can use this:

game.Players.PlayerAdded:connect(function(player)

if player:WaitForDataReady() then

    player.CameraMode = "LockFirstPerson"

end

end)

--just know that this is roblox's built in fps camera. It is buggy.

This discussion is preserved as it was. New answers, comments, and votes are closed.