I am working on zombie survival and trying to edit a few functions. I have added zombie npc’s like in zombie outbreak. I need help with setting up a function or a few functions that add points when you kill a zombie npc’s. I am talking headcrabs,fast zombies,normal zombies, zombie torso’s,poison zombies and poison headcrabs. I have a function like this set up/ well that’s what i been working with.
function GM:OnNPCKilled(ent, attacker, inflictor) if NPCS and attacker:IsPlayer() and attacker:Team() == TEAM_HUMAN then attacker:AddPoints(7) self:CheckPlayerScore(attacker) end end
I do not know much about Lua. I am more use to older MSDOS. I been trying to teach myself Lua but it has been rough going and i don’t have much time for it right now.
I also used these resources https://wiki.garrysmod.com/page/GM/OnNPCKilled
I am not sure what is out of date and what is up to date.
I also have other code. well code from zombie outbreak/deathlegends and would like to possible use some of it in my gamemode. There gamemode works, well kinda right now there is a problem with the wraith models I have heard but have not confirmed this.
I changed some code in zombie survival and basicly turned it into zombie outbreak. I need help with making it so when you kill zombies you get points. I see in the code that after 60 secs of not getting hurt you get 2 points. that is the only point system i could find in zombie survival and tried to applied it to the GM:OnNPCKilled function. when i played around with it. i did get it so i did not get error’s in the console but then again points did not register eithermaybe has to do with “net messages”?