Adding kills to the kill feed?

I’m using ent:Kill() for a Swep, but I want to add the kill to the feed.

I can’t seem to find the command anywhere.

GAMEMODE:AddDeathNotice( attacker:Name(), attacker:Team(), inflictor, victim, **-**1 )

[editline]27th August 2014[/editline]

Doesn’t Entity:Kill() add killfeed notification anyway?

Yes, it does. I realized I was thinking about two different things.

I wanted to kill a player after his health was less than 0, but without printing a suicide.

You can use Entity:KillSilent(), but that will also prevent all OnPlayerDeath hooks from being called.

Right, although KillSilent() makes the player disappear on death.

I thought players normally die if below 0, but I guess if you’re using SetHealth() they don’t.

Is there a function to apply damage?

EDIT: Nvm, I think this is what I want Entity:TakeDamage

There’s no a command, ent:Kill() only suicides to the player, you must create a buller or use TakeDamage against that ent

ent:TakeDamage() gives me nil, not sure why.

Read the documentation:

2nd argument it’s what caused the damage, not who, the third it’s who caused it

second argument is “who” caused, third is “what” caused.

[editline]28th August 2014[/editline]

Check if target is valid:

if ( IsValid( target ) ) then damage end