Gmod entity armor shop with derma

Hello facepunch, as you can probably see from the code i have been working on a shop entity for armor on Darkrp and i have run into a few problems.

  1. cant call player in function to give players armor and take their rpmoney.

  2. wanting to close the derma menu once armor is given and paid for. (I don’t understand how i can communicate through to the client to close the derma panel once armor is bought.

I am new to Lua and i have spent ages trying to sort this out. Help would be really appreciated as don’t know any ways of setting this up.

Init.lua


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

function ENT:Initialize()

self:SetModel("models/Items/ammocrate_grenade.mdl")
self:PhysicsInit(SOLID_VPHYSICS)
self:SetMoveType(MOVETYPE_VPHYSICS)
self:SetSolid(SOLID_VPHYSICS)
local phys = self:GetPhysicsObject()
if phys:IsValid() then
	phys:Wake()

	end
end


function ENT:Use(activator,caller)
	self:SetUseType(SIMPLE_USE)
	umsg.Start("DrawShopMenu", activator)
	umsg.Short("1")
	umsg.End()
	

end

util.AddNetworkString("buttonpress1")
net.Receive("buttonpress1", buttonpress1)


function buttonpress1(ply)
ply:Armor(100)
end


	



cl_init.lua


include("shared.lua")

function ENT:Draw()


self:DrawModel()

end

function DrawShopMenu()
local frame = vgui.Create("DFrame")
    frame:SetSize(400, 100)
    frame:Center()
    frame:SetTitle('Armor Shop')
    frame:ShowCloseButton(true)
    frame:SetSizable(false)
    frame:SetDeleteOnClose(true)
    frame:MakePopup()
	
	local button = vgui.Create("DButton",frame)
	button:SetPos (10,55)
	button:SetSize(100,40)
	button:SetText("Yes")
	button.DoClick = function()
	net.Start("buttonpress1")
	net.SendToServer()
	end
	
	
	local button2 = vgui.Create("DButton",frame)
	button2:SetPos (290,55)
	button2:SetSize(100,40)
	button2:SetText("No")
	
	
	local label = vgui.Create("DLabel",frame)
	label:SetPos(90,30)
	label:SetText("Would you like to purchase armor for $20000?")
	label:SetSize(240,16)
	
end
usermessage.Hook("DrawShopMenu",DrawShopMenu)





Redoned code.

May be errors because writen from lhone