So I've got this scope script bound to "q" and whenever I scope in and then out, I'm back to Third-Person. Any way to avoid this?
Tool = script.Parent Player = game.Players.LocalPlayer Cam = game.Workspace.CurrentCamera Tool.Unequipped:connect(function() Cam.FieldOfView = 80 Player.CameraMode = "Classic" if Player.PlayerGui:FindFirstChild("Scope") ~= nil then Player.PlayerGui.Scope:Destroy() end end) zoomed = false function ZOOM(key) if key then key = string.lower(key) if (key=="q") and not zoomed then zoomed = true Cam.FieldOfView = 20 Player.CameraMode = "LockFirstPerson" if Player.PlayerGui:FindFirstChild("Scope") == nil then script.Parent.Scope:Clone().Parent = Player.PlayerGui end elseif key == "q" and zoomed then zoomed = false Cam.FieldOfView = 80 Player.CameraMode = "Classic" if Player.PlayerGui:FindFirstChild("Scope") ~= nil then Player.PlayerGui.Scope:Destroy() end end end end Tool.Equipped:connect(function(mouse) mouse.KeyDown:connect(ZOOM) end)
They have added a StarterPlayer folder to roblox, in there there is a camera option to keep you in first person, without scripts
Cam.CameraMode = "LockFirstPerson"
I'm pretty sure that's what you're looking for.
EASY local plr = game.Players.localPlayer local cam = game.workspace.CurrentCamera local chr = nil
chr = character plr.CameraMode = 1
while false do wait () cam.CameraType = 0 cam.CoordinateFrame = CFrame.new (200,10,0) cam.focus = CFrame.new (200,7,500) cam.FieldOfView = 20 end
Put it in starter GUI