NPC Shop help

I’m creating a Ammo vendor for my Gamemode, using ENT:Use to open a gui on the client, nothing happens when you press “USE” on it.

Entity’s init.lua


function ENT:Use()
util.AddNetworkString( 'OpenNPC' )
	net.Start( 'OpenNPC' )
	net.Send( v )
end

gamemode’s cl_init.lua


	net.Receive( 'OpenNPC', function()
		local shoppanel = vgui.Create( 'DFrame' )
			shoppanel:SetSize( 1000, 700 )
			shoppanel:Center()
			shoppanel:SetTitle( 'Ammo Vendor' )
			shoppanel:ShowCloseButton( true )
			shoppanel:SetDraggable( false )
			shoppanel:MakePopup()
			function shoppanel:Paint( w, h )
				draw.RoundedBox( 0, 0, 0, w, h, Color( 255, 150, 30, 100 ) ) 
				surface.SetDrawColor( 0, 0, 0 )
				surface.DrawOutlinedRect( 1, 1, w-2, h-2 )
			end

		local item = vgui.Create( 'DButton' )
			item:SetParent( shoppanel )
			item:SetSize( 300, 280 )
			item:SetPos( 730, 45 ) 
end )

Please tell me whats wrong with this, i’ve looked over it and nothing seems wrong

I don’t really use the net library, but your cl_init has OpenNPC for the name of the message, but your entity’s init has NPCShop. I don’t think that’s right.

I didn’t look at the rest of the stuff.

Ok any ideas of what to use then, I’ll try changing the net.Receive

Also don’t call util.AddNetworkString every use, do that somewhere that will be run only once.