Advertisement
Guest User

Untitled

a guest
Jun 21st, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. local exec = client.exec
  2. local userid_to_entindex = client.userid_to_entindex
  3. local get_local_player = entity.get_local_player
  4. local ui_get = ui.get
  5.  
  6. local alt_hitmarker_enable = ui.new_checkbox("AA", "Other", "Alternate hit marker sound")
  7.  
  8. local function on_player_hurt(e)
  9. if not ui_get(alt_hitmarker_enable) then
  10. return
  11. end
  12.  
  13. local attacker_userid = e.attacker
  14. if attacker_userid == nil then
  15. return
  16. end
  17.  
  18. local attacker_entindex = userid_to_entindex(attacker_userid)
  19.  
  20. if attacker_entindex == get_local_player() then
  21. exec("playvol */hitsound.wav 1")
  22. end
  23. end
  24.  
  25. client.set_event_callback("player_hurt", on_player_hurt)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement