• Custom Entities + dupes.
    3 replies, posted
This is a DarkRP server. 1.[B]My custom entities being an armor dispenser and health dispenser don't work as they should, they don't blow up when shot at and don't give the health / armor[/B] This is the partial code. [lua]function ENT:Initialize() self:SetModel("models/props_combine/health_charger001.mdl") self:PhysicsInit(SOLID_VPHYSICS) self:SetMoveType(MOVETYPE_VPHYSICS) self:SetSolid(SOLID_VPHYSICS) local phys = self:GetPhysicsObject() if phys and phys:IsValid() then phys:Wake() end self.damage = 100 end function ENT:OnTakeDamage(dmg) self.damage = self.damage - dmg:GetDamage() if (self.damage <= 0) then self:Destruct() self:Remove() end function ENT:Use(activator,caller) if activator:Health() < 100 then self:EmitSound("WallHealth.Start") activator:SetHealth(activator:Health() + 1) end end[/lua]
Anyone?
..
I still haven't been able to figure out how to fix it, the only two issues though is that you can't destroy it and it has no effect when you press "e" on it.
Sorry, you need to Log In to post a reply to this thread.