ColinStroble

Untitled

Aug 22nd, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. function Sounds( Event, Entity )
  2.  
  3. if ( Event:GetName() == 'player_hurt' ) then
  4.  
  5. local ME = client.GetLocalPlayerIndex();
  6.  
  7. local INT_UID = Event:GetInt( 'userid' );
  8. local INT_ATTACKER = Event:GetInt( 'attacker' );
  9.  
  10. local NAME_Victim = client.GetPlayerNameByUserID( INT_UID );
  11. local INDEX_Victim = client.GetPlayerIndexByUserID( INT_UID );
  12.  
  13. local NAME_Attacker = client.GetPlayerNameByUserID( INT_ATTACKER );
  14. local INDEX_Attacker = client.GetPlayerIndexByUserID( INT_ATTACKER );
  15.  
  16. if ( INDEX_Attacker == ME and INDEX_Victim ~= ME ) then
  17. client.Command("play buttons\\arena_switch_press_02.wav", true);
  18. end
  19.  
  20. end
  21.  
  22. end
  23.  
  24. client.AllowListener( 'player_hurt' );
  25.  
  26. callbacks.Register( 'FireGameEvent', 'Hitsound', Sounds );
Add Comment
Please, Sign In to add comment