GMOD Deathrun Third Person LUA Script HELP!

Ok, so im making a deathrun server and I have this 3rd person lua script I found on another thread,


function TPerson(ply, pos, angles, fov)
    local view = {}
    view.origin = pos-(angles:Forward()*100) +
                            (angles:Right()*0) +
                                    (angles:Up()*10)
        view.angles = angles
        view.fov = fov
 
    return view
end
 
hook.Add("CalcView", "TPerson", TPerson)
 
hook.Add("ShouldDrawLocalPlayer", "ShouldDrawLocalPlayer", function(ply)
        return true
end)

It works but I would like to make it to be able to toggle it with a key, so press a key to go into third person then press it again to go back into first person.

any help would be great! thanks!


(User was banned for this post ("wrong section" - postal))