Advertisement
Guest User

Untitled

a guest
Apr 28th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. if ( CLIENT ) then
  2. local on = false
  3.  
  4. local function simpletoggle()
  5.  
  6. on = !on
  7.  
  8. if on == true then
  9.  
  10. LocalPlayer():ConCommand( "simple_thirdperson_enabled 1" )
  11.  
  12. LocalPlayer():PrintMessage( HUD_PRINTTALK, "Third person mode enabled." )
  13.  
  14. else
  15.  
  16. LocalPlayer():ConCommand( "simple_thirdperson_enabled 0" )
  17.  
  18. LocalPlayer():PrintMessage( HUD_PRINTTALK, "Third person mode disabled." )
  19.  
  20. end
  21.  
  22. end
  23.  
  24.  
  25. concommand.Add( "simple_toggle", simpletoggle )
  26. end
  27.  
  28. if ( SERVER ) then
  29. hook.Add( "PlayerSay", "PlayerSayExample", function( ply, text, team )
  30. if(string.sub( text, 1, 12) == "!thirdperson" ) then
  31. ply:ConCommand( "simple_thirdperson_enable_toggle" )
  32. return(false)
  33. end
  34. end)
  35.  
  36.  
  37. hook.Add("PlayerButtonDown","IDC",function(ply,key)
  38.  
  39. if key == KEY_T then
  40. ply:ConCommand( "simple_toggle" )
  41. end
  42.  
  43. end)
  44.  
  45. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement