darkrp armor entiety problem

Hey, so i have armor shipments,but i want the armor entiety to when picked up give the maximum armor that my caracter starts with,and not a setup amount like (example 100).
my player spawns with 150 armor because he is vip,i cant make 150 armor shipments for everyone,so how do i make armor entiety go get me full armor instead of a value?

You can override SetArmor and create a SetMaxArmor function to check if the player’s armor will exceed the desired amount.

was like this:function ENT:Use(plyUse)
self:Remove()
plyUse:SetArmor(100)
end

now like this:
function ENT:Use(plyUse)
self:Remove()
plyUse:SetMaxArmor
end
Now i just cant pick it,it dont work

No, I meant to remake the SetArmor function to have a cap. It will require you to override it.

can you reply with the fix please,if this is it i think

AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(‘shared.lua’)

function ENT:Initialize()
self.Entity:SetModel(“models/combine_vests/bogvest.mdl”)
self.Entity:PhysicsInit(SOLID_VPHYSICS)
self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
self.Entity:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)

local phys = self.Entity:GetPhysicsObject()
self.nodupe = true
self.ShareGravgun = true

if phys and phys:IsValid() then phys:Wake() end
self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS) 

end

function ENT:SpawnFunction(ply, tr)
if (!tr.Hit) then
return end

local SpawnPos = tr.HitPos + tr.HitNormal

local ent = ents.Create("Heavy Kevlar Armor")
ent:SetPos(SpawnPos)
ent:Spawn()
ent:Activate()
 	 
return ent 

end

function ENT:Use(plyUse)
self:Remove()
plyUse:SetArmor(100)
end

function ENT:OnRemove()
self:Remove()
end


local _R = debug.getregistry()

local _SetArmor = _R.Player.SetArmor
local _R.Player.m_iMaxArmor = 150

AccessorFunc( _R.Player, "m_iMaxArmor", "MaxArmor", FORCE_NUMBER )

function _R.Player:SetArmor( iArmor )
   _SetArmor( math.min( self:GetMaxArmor(), self:GetArmor + iArmor ) )
end

Run that serverside.

If you mean like this:
AddCSLuaFile(“cl_init.lua”)
AddCSLuaFile(“shared.lua”)
include(‘shared.lua’)

function ENT:Initialize()
self.Entity:SetModel(“models/combine_vests/bogvest.mdl”)
self.Entity:PhysicsInit(SOLID_VPHYSICS)
self.Entity:SetMoveType(MOVETYPE_VPHYSICS)
self.Entity:SetSolid(SOLID_VPHYSICS)
self:SetUseType(SIMPLE_USE)

local phys = self.Entity:GetPhysicsObject()
self.nodupe = true
self.ShareGravgun = true

if phys and phys:IsValid() then phys:Wake() end
self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS) 

end

function ENT:SpawnFunction(ply, tr)
if (!tr.Hit) then
return end

local SpawnPos = tr.HitPos + tr.HitNormal

local _R = debug.getregistry()

local _SetArmor = _R.Player.SetArmor
local _R.Player.m_iMaxArmor = 150

AccessorFunc( _R.Player, “m_iMaxArmor”, “MaxArmor”, FORCE_NUMBER )

function _R.Player:SetArmor( iArmor )
_SetArmor( math.min( self:GetMaxArmor(), self:GetArmor + iArmor ) )
end

still cant pick it up

No, in a separate serverside file, not in the ent file.