On hit play sound

So i’m trying to get back into GMod lua and i just want to know how to make it so when a player deals damage to another player it plays a sound for the attacker, like the hit notification for TF2.

Reason i’m asking is i have no idea what hooks to use or even look for to get this working.

Use **[Gamemode.EntityTakeDamage

http://wiki.garrysmod.com/favicon.ico](wiki.garrysmod.com/?title=Gamemode.EntityTakeDamage)** to send a user message to the attacker, then play the sound clientside using **[Surface.PlaySound

http://wiki.garrysmod.com/favicon.ico](http://wiki.garrysmod.com/?title=Surface.PlaySound)**

Would be better to use Entity.EmitSound, in this case. (which can also be used server side)

<newbie here>

i could not use the function [lua]Entity:OnTakeDamage()[/lua] ??

That’s a scripted entity hook, players aren’t scripted entities.

thanks :smiley: