DarkRP armor entity

Hello,

so I have been trying to make an armour entity that gives 100% armour on use.
First problem I have encountered is that when I use the entity it doesn’t give armour and it “disappears” or better explained it just becomes invisible except for its shadow.
The prop is still touchable via gravitygun and physgun so it doesn’t get removed properly.

Here are the 3 files:

init.lua



AddCSLuaFile("cl_init.lua")
AddCSLuaFile("shared.lua")

include("shared.lua")

function ENT:Initialize()
	self:SetModel("models/Items/battery.mdl")
end

function ENT:Use( activator, caller, useType, value )
	activator:SetArmor( 100 )
	self.Entity:Remove()
end


cl_init.lua



include("shared.lua")

function ENT:Draw() end

function ENT:Initialize()
	self:DrawShadow(false)
end


shared.lua



ENT.Type = "anim"
ENT.Base = "base_gmodentity"
ENT.PrintName = "Kevlar"
ENT.Author = "『 』"
ENT.Spawnable = false
ENT.AdminSpawnable = true


No one?

It’s invisible because your ENT:Draw() does nothing so just remove that line.

still no armour given

self:CPPISetOwner() in init
since you are using DarkRP, which includes FPP, which uses CPPI.

why should I set an owner?

put self:DrawModel(); in ENT:Draw()?

thx for all the advice I already fixed it by copying some stuff from spawned_weapon