Swep function taking place on hit

I’m missing something silly here, I just know it, but gmod’s lua wiki brings nothing up.

Right now, I have this:


function SWEP:OnPlayerDamaged(ent)
	(stuff)
end

I need it to take place on hit, rather than when you kill something with it.

Nevermind, found it.
I should have realised I was working with gamemode functions since I was making a weapon for the gamemode :v:

Shit, Forgot automerge breaks after an hour.