Animation issue on NPC's (that have been customized in .lua)
0 replies, posted
So I have been dealing with a handful of problems on my addon. Firstly, I cannot seem to make my custom NPC's preform any animations at all, and I cannot seem to undo the ragdolls of the custom NPC.
ifmath.random(1,10) == 1then
Antlion1 = ents.Create("npc_emberlion")
Antlion1:SetKeyValue( "startburrowed", "1" )
Antlion1:SetPos( self.npc:GetPos() + self.npc:GetRight() * math.random(-180,-200))
Antlion1:DropToFloor()
Antlion1:Spawn()
Antlion1:Activate()
timer.Simple(3,function()
Antlion1:Fire("Unburrow")
end)
(This is part of a function not the whole thing, and if anything is combined in the code like "ifmath.random", it's not originally in the code, I just suck at pasting it and fixing it.)
So long story short, the "Antlion1:Fire("Unburrow")" does not work for the NPC's I have created. It does work on the normal Antlions somehow.
Another issue is having my NPC's ragdoll undo-ed when you undo the NPC. While deleting the physical NPC is fine, the ragdoll isn't and I am not sure why.
function ENT:OnRemove()if IsValid(self.npc) then
self.npc:Remove()
endif IsValid(self.corpse) then
self.corpse:Remove()
endend
I don't know what I can do and any feedback would be appreciated!
Thank you and I hope you all have a great day!
Sorry, you need to Log In to post a reply to this thread.