[CODE]function ENT:MakeGun()
local gun = ents.Create("prop_physics") --errors here?
gun:SetPos(self:GetPos()+Vector(0,0,20))
gun:SetModel("models/weapons/w_models/w_minigun.mdl")
gun:SetParent(self)
gun:SetAngles(Angle(self:GetAngles().pitch,self:GetAngles().yaw +180,self:GetAngles().roll))
gun:Spawn()
self.gun = gun
end[/CODE]
It all works fine, the prop is spawned and all setting are applied, but Console is flooded with the error "attempt to call field "Create" (a nill value)". I don't understand what it's pissed about.
don't call it clientside
damn, that was fast
Sorry, you need to Log In to post a reply to this thread.