Garry's Mod Wiki

WEAPON:TranslateFOV

  number WEAPON:TranslateFOV( number fov )

Description

Allows to change players field of view while player holds the weapon.

This hook must be defined shared and return same value on both to properly affect Area Portals.

Arguments

1 number fov
The current/default FOV.

Returns

1 number
The target FOV.

Example

Reduces players FOV by 30.

function SWEP:TranslateFOV( fov ) return fov - 30 end
Output: Players view is zoomed in.