Need Help with mostly basic npc

few days ago I started work playing around trying to make simple rebel NPC that shots mostly anything, so far it does mostly what I need it to do, I just have a few problems…

  1. When it dies it doesn’t drop dead on the spot, it wonders (to I think the closest npc node), then drops dead.

  2. When it empties a clip, It doesn’t reload, just stands there and starts walking around again.

I’ve figured out how to get it to do most of what I need it to do, but these two things keep holding me up… And solution?

"TASK_RELOAD"

[lua]
function ENT:OnTakeDamage(dmg)
self:SetHealth(self:Health() - dmg:GetDamage())
if self:Health() <= 0 then //run on death
self:SetSchedule( SCHED_FALL_TO_GROUND ) //because it’s given a new schedule, the old one will end.
end
end
[/lua]

[sarcasm]Thank you for linking me to the wiki page I’ve already read and checked multiply times… [/sarcasm]
though when I use the full setup for the npc on the wiki it does work, the animations are often worsely placed then my current set up (when the wikiNPC arrives at a point, it stands there, puts it’s arms out in the ‘T’ shape of the idle animation, then starts shooting… My NPC has no random ‘T’ shape before shooting)

and the wikiNPC doesn’t die…