The_Belch

Metallic Hit Sounds

Jul 2nd, 2019
350
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. local MSC_PART_REF = gui.Reference( "MISC", "ENHANCEMENT", "Hitmarkers" );
  2.  
  3. local AWMetallicHitsound = gui.Checkbox( MSC_PART_REF, "lua_metallichitsound", "Metallic Hitsound", 0 );
  4.  
  5. local function MetallicHitsound( Event )
  6.  
  7. if AWMetallicHitsound:GetValue() then
  8.  
  9. if gui.GetValue( "msc_hitmarker_enable" ) then
  10. gui.SetValue( "msc_hitmarker_volume", 0 );
  11. end
  12.  
  13. if ( Event:GetName() == "player_hurt" ) then
  14.  
  15. local ME = client.GetLocalPlayerIndex();
  16.  
  17. local INT_UID = Event:GetInt( "userid" );
  18. local INT_ATTACKER = Event:GetInt( "attacker" );
  19.  
  20. local NAME_Victim = client.GetPlayerNameByUserID( INT_UID );
  21. local INDEX_Victim = client.GetPlayerIndexByUserID( INT_UID );
  22.  
  23. local NAME_Attacker = client.GetPlayerNameByUserID( INT_ATTACKER );
  24. local INDEX_Attacker = client.GetPlayerIndexByUserID( INT_ATTACKER );
  25.  
  26. if ( INDEX_Attacker == ME and INDEX_Victim ~= ME ) then
  27. client.Command( "play buttons\\arena_switch_press_02.wav", true );
  28. end
  29.  
  30. end
  31.  
  32. end
  33.  
  34. end
  35.  
  36. client.AllowListener( "player_hurt" );
  37.  
  38. callbacks.Register( "FireGameEvent", "Metallic Hitsound", MetallicHitsound );
Add Comment
Please, Sign In to add comment