Tracking NPC kills in console/scoreboard and console command to reset scores.
1 replies, posted
Since when players are killed by NPCs, a message appears in console noting such, I'd like it to work both ways, for example...
(name) killed (npc) with (weapon)
I'd also like each NPC kill to be tracked on the scoreboard, as well as a console command to set everyone's scores (kills and deaths) to 0 (resetscores or something to that effect).
That's pretty much it, thanks for reading.
[B]EDIT:[/B] Apparently I already have NPC kills tracking on the scoreboard, so omit that from the code, but the rest is still stuff that I want.
ok well theres a hook in garrysmod that tracks player death:
[lua]
function GM:OnNPCKilled(npc, attacker, weapon)
// oh shit an npc died :(
print(npc:GetClass() .. " was killed by " .. attacker);
for k,v in pairs(player.GetHumans()) do
v:SetFrags(0);
end
end
function GM:PlayerDeath(ply, attacker, killer)
// player died!
print(ply:GetName() .. " was killed by " .. killer);
end
[/lua]
all of this is server side
this code wasnt meant to solve your problem but it will get you on the right track :)
Sorry, you need to Log In to post a reply to this thread.