Heads up: this is my first post so please don’t get annoyed if I’ve put this in the wrong thread.

Hey everyone,

Alright so I’m having trouble trying to toggle third person with F3, I’ve already got some code to toggle third person with a console command, but I cannot seem to get it working with the F3 toggling in it.

Here’s my current code:

```
if ( CLIENT ) then
local on = true
local function toggle()
on = !on
if on == true then else end
end
hook.Add( "ShouldDrawLocalPlayer", "ThirdPersonDrawPlayer", function()
if on and LocalPlayer():Alive() then
return true
end
end )
hook.Add( "CalcView", "ThirdPersonView", function( ply, pos, angles, fov )
if on and ply:Alive() then
local view = {}
view.origin = pos - ( angles:Forward() * 70 ) + ( angles:Right() * 20 ) + ( angles:Up() * 5 )
view.angles = ply:EyeAngles() + Angle( 1, 1, 0 )
view.fov = fov
return GAMEMODE:CalcView( ply, view.origin, view.angles, view.fov )
end
end )
concommand.Add( "thirdperson_toggle", toggle )
end
```

Help is much appreciated