game:GetService("UserInputService").InputBegan:connect(function(inputObject, gameProcessedEvent)
if gameProcessedEvent and inputObject.KeyCode == Enum.KeyCode.T then
if toggle == true then
humanoid.CameraOffset = Vector3.new(0,0,-1)
player.CameraMaxZoomDistance = 0.5
player.CameraMinZoomDistance = 0.5
toggle = false
else
humanoid.CameraOffset = Vector3.new(0,0,0)
player.CameraMaxZoomDistance = 12
player.CameraMinZoomDistance = 6
toggle = true
end
end
end)
This script should switch you to the first person and 3rd person changing min and max zoom distance to 0.5/0.5 (first person) or 12/6 (third person) but for some reason when I test it and try to switch min/max zoom distance, it changes min zoom distance to 6 only and not 0.5

1 comment
you are using a game processed event, that'll return a constant value so it'll keep on updating forcing it to be stuck at 6. Instead replace gameProcessedEvent with if key == Enum.UserInputState.Begin