local ui_text = Menu.Text('Hitsound', 'Filepath: /csgo/sound/hitsounds | Note: Make sure file type is .wav')
local ui_enabled = Menu.Switch('Hitsound', 'Enabled', false)
local ui_sound_one = Menu.TextBox('Hitsound', 'Head shot', 64, 'Sound')
local ui_sound_two = Menu.TextBox('Hitsound', 'Body aim', 64, 'Sound')
Cheat.RegisterCallback('registered_shot', function(shot)
local enabled = ui_enabled:Get()
local headshot = ui_sound_one:Get()
local bodyaim = ui_sound_two:Get()
if not enabled then return end
local hitbox = shot.hitgroup
local reason = shot.reason
if shot.reason ~= 0 then return end
if hitbox == 1 then
EngineClient.ExecuteClientCmd(string.format('playvol hitsounds/%s 1', headshot))
else
EngineClient.ExecuteClientCmd(string.format('playvol hitsounds/%s 1', bodyaim))
end
end)