Is there a way to lock only 1 team to First Person

Although, if you absolutely insist on an constant loop that does it, just add this to the very bottom:

while wait() do
	myTeamChanged()
end


I found the code, what do I change to make it first-person mode for only the teams I set

Add -- before all 3 of those lines, it should appear grey like the first line if you did it properly. That will make the code be ignored, and it will not run.

The FirstPersonLock script doesn’t work now and got a discord so I can just message you from there.

Xep#7346

Edit: I don’t know how I missed the other 4 references, but I’ll blame my tiredness.

All of the lines in the red boxes should be commented out. Then it should work @MightismWyven

Honestly, since editing these values is causing bugs, try changing it to this:

local Player = game.Players.LocalPlayer
local Character = Player.Character or Player.CharacterAdded:wait()
local FirstPersonTeamName = "TeamA" -- change this to whatever team you want locked in first person. ALL other teams will have the default camera. It will update if you switch their team later.

function myTeamChanged()
	local MyTeam = Player.Team -- see https://developer.roblox.com/en-us/api-reference/class/Team
	
	-- Example of how you can detect the team by name:
	if MyTeam.Name == FirstPersonTeamName then
		Player.CameraMode = Enum.CameraMode.LockFirstPerson
	else
		Player.CameraMode = Enum.CameraMode.Classic
	end
end

if Player.Team then
	myTeamChanged()
end

Player.Changed:connect(function(Property)
	if Property == "Team" or Property == "CameraMode" then
		myTeamChanged()
	end
end)

Everytime your CameraMode is changed, it should now change back. Hopefully the gun’s code wont intefere with that.

I would revert the gun code back to the original and then give the code above a shot.