DarkRP Armor based shipments.

I wanted to create a shipment that spawns a model and when clicked it gives the player full armor. Is this possible and if so how would I go about it? Thanks guys.

Go into your entities folder, make a copy of any folder, then name it “armor”, open init.lua and place:



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

include("shared.lua")

function ENT:Initialize()
	self:SetModel("PUT THE MODEL HERE")
	self:PhysicsInit(SOLID_VPHYSICS)
	self:SetMoveType(MOVETYPE_VPHYSICS)
	self:SetSolid(SOLID_VPHYSICS)
	self:SetUseType(SIMPLE_USE)

	self:SetCollisionGroup(COLLISION_GROUP_INTERACTIVE_DEBRIS)
	local phys = self:GetPhysicsObject()

	phys:Wake()
	hook.Add("PlayerDisconnected", self, self.onPlayerDisconnected)
end


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


Then in addentities:



AddCustomShipment("Armor", "PUT MODEL HERE", "armor", PriceForShipment, 5, true, PriceForSingle, false, {TEAM_???})


Replace PriceForShipment with the price for a shipment,
the 5 is how many of them is in the shipment, and PriceForSingle is how much one costs.
Replace TEAM_??? with for example TEAM_BMD for Black Market Dealer.

Thank you man. Thank you so much!