Is it possible?
I'm currently trying to re-create the original half life zombies using nextbots, and for the zombie I would like a headcrab to be attached to him.
I tried doing this, but the headcrab would just slide off/be attached weirdly/still be awake:
[code]
function ENT:Initialize()
self:SetModel("models/Zombie/Classic.mdl");
self:SetHealth(150);
local headcrab = ents.Create("npc_headcrab")
local attachment = self:GetAttachment(self:LookupAttachment("headcrab"));
headcrab:SetPos(attachment.Pos);
headcrab:Spawn();
headcrab:SetParent(self, 1);
headcrab:SetSolid(SOLID_NONE);
end
[/code]
Any ideas would be appreciated.
Thanks
Zombie model has a bodygroup for this.
What you are doing is wrong, its not how its done.
[QUOTE=Robotboy655;51092364]Zombie model has a bodygroup for this.
What you are doing is wrong, its not how its done.[/QUOTE]
-snip-
nevermind, thank you!
[editline]23rd September 2016[/editline]
Sorry, I have one more question. Is there a way to see if a nextbot got headshotted?
[QUOTE=whitestar;51092947][url]https://facepunch.com/showthread.php?t=1167676&p=34971687&viewfull=1#post34971687[/url][/QUOTE]
But those hooks are for when a player gets hit, not a nextbot, and the nexbot OnInjured function doesn't give you the hitgroup they were hit in anyway.
Look through this file, they found a way to get the position out of hitboxes, complicated for beginners, but should work:
[url]https://github.com/wyozi-gmod/budgetday/blob/master/entities/entities/bd_nextbotbase.lua[/url]
And they made a custom OnInjured function, where they use the top table of the hitboxes, found at the bottom(or simply use the link)
[url]https://github.com/wyozi-gmod/budgetday/blob/master/entities/entities/bd_nextbotbase.lua#L501-L529[/url]
Nothing is impossible ;)
Sorry, you need to Log In to post a reply to this thread.