Make player into firstperson lock when gui button pressed

i am pretty new to making player firstperson in script…anyways here’s the script

--variables
local PlayButton = script.Parent.PlayButton 
local UpdateLogButton = script.parent.UpdateLogButton  
local MainFrame = script.Parent
local ChangeLogFrame = script.Parent.Parent.ChangeLog
local ChangeLogButton = script.Parent.UpdateLogButton

PlayButton.MouseButton1Click:Connect(function()
	MainFrame.Visible = false
	wait(0.5)
	-- I guess firstpersonlock goes here
end)

UpdateLogButton.MouseButton1Click:Connect(function()
	ChangeLogFrame.Visible = true
end)

You can use this and set the CameraMode to LockFirstPerson (assuming you’re in a LocalScript):

Example:

local Players = game:GetService("Players")
--blah blah blah rest of code

button.MouseButton1Click:Connect(function()
     --do whatever you want
    Players.LocalPlayer.CameraMode = Enum.CameraMode.LockFirstPerson
end)