• Adding kills to the kill feed?
    8 replies, posted
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, [B]-[/B]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. [IMG]http://i.imgur.com/fx73gJn.png[/IMG]
Read the documentation: [url]http://wiki.garrysmod.com/page/Entity/TakeDamage[/url] 2nd argument it's what caused the damage, not who, the third it's who caused it
[QUOTE=gonzalolog;45820118]Read the documentation: [url]http://wiki.garrysmod.com/page/Entity/TakeDamage[/url] 2nd argument it's what caused the damage, not who, the third it's who caused it[/QUOTE] second argument is "who" caused, third is "what" caused. [editline]28th August 2014[/editline] [QUOTE=Winter;45818192]ent:TakeDamage() gives me nil, not sure why. [IMG]http://i.imgur.com/fx73gJn.png[/IMG][/QUOTE] Check if target is valid: if ( IsValid( target ) ) then damage end
Sorry, you need to Log In to post a reply to this thread.