Advertisement
Guest User

Untitled

a guest
Sep 10th, 2011
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.26 KB | None | 0 0
  1. /*
  2.     LU Headshot Script
  3.     --------------------------------------------------
  4.     Author: Juppi
  5. */
  6.  
  7. g_LocalPlayer <- FindLocalPlayer();
  8.  
  9. function onScriptLoad()
  10. {
  11.     local pSound = FindSound( "headshot.wav" );
  12.     if ( pSound )
  13.     {
  14.         pSound.Open();
  15.     }
  16.     return 1;
  17. }
  18.  
  19. function onClientShot( pPlayer, iWeapon, iBodypart )
  20. {
  21.     // Apply this for weapons starting from shotgun only
  22.     if ( ( iBodypart == BODYPART_HEAD ) && ( iWeapon > 3 ) )
  23.     {
  24.         g_LocalPlayer.RemoveLimb( BODYPART_HEAD ); // Remove head
  25.         g_LocalPlayer.Health = 1; // Kill the player >:D (We need to use health=1, otherwise the script will think we want to suicide rather than get killed by someone)
  26.     }
  27.    
  28.     return 1;
  29. }
  30.  
  31. function onClientKill( pPlayer, iWeapon, iBodypart )
  32. {
  33.     if ( ( iBodypart == BODYPART_HEAD ) && ( iWeapon > 3 ) )
  34.     {
  35.         local pSound = FindSound( "headshot.wav" );
  36.         if ( pSound )
  37.         {
  38.             pSound.Play();
  39.             BigMessage( "~r~HEADSHOT", 3000, 3 );
  40.         }
  41.     }
  42.    
  43.     return 1;
  44. }
  45.  
  46. function onClientDeath( pKiller, iWeapon, iBodypart )
  47. {
  48.     if ( pKiller )
  49.     {
  50.         if ( ( iBodypart == BODYPART_HEAD ) && ( iWeapon > 3 ) )
  51.         {
  52.             local pSound = FindSound( "headshot.wav" );
  53.             if ( pSound )
  54.             {
  55.                 pSound.Play();
  56.                 BigMessage( "~r~HEADSHOT", 3000, 3 );
  57.             }
  58.         }
  59.     }
  60.    
  61.     return 1;
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement