Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if CLIENT then
- local on = false
- function togglethirdperson()
- on = not on
- end
- net.Receive("sv_togglethirdperson")
- function CalcThirdperson(ply, pos, angles, fov)
- if on then
- local view = {}
- view.origin = pos-(angles:Forward()*100)
- view.angles = angles
- view.fov = fov
- return view
- end
- end
- hook.Add("CalcView", "CalcThirdperson", CalcThirdperson)
- hook.Add("ShouldDrawLocalPlayer", "MyHax ShouldDrawLocalPlayer", function(ply)
- if on then
- return true
- end
- end)
- concommand.Add("togglethirdperson", togglethirdperson)
- local lastf4 = false
- hook.Add( "Tick", "CheckPlayerKey", function()
- if (input.IsKeyDown(KEY_F4) and lastf4 == false) then
- togglethirdperson()
- lastf4 = true
- timer.Simple(0.1,function()
- lastf4 = false
- end)
- end
- end )
- end
Advertisement
Add Comment
Please, Sign In to add comment