DViewList not working correctly with a networked variable

Hey everyone

I’m trying to make a system where when a physics prop is used (picked up), it adds its name to a DViewList along with the amount in the player has. The problem is, the name isn’t showing up, and it has only run the function o

Here’s the serverside code


local function PlayerUse( ply, ent )
	local enttype = ent:GetClass()
	local entname = ent:GetName()
	if ( enttype == "prop_physics" ) then
		ent:Remove()
		util.AddNetworkString( "EntityName" )
		net.Start( "EntityName" )
		net.WriteString( entname )
		umsg.Start( "AddItem", ply )
		umsg.End()
	end
end

hook.Add( "PlayerUse", "Use Prop", PlayerUse )

Here’s clientside


function AddItem()
		net.Receive( "EntityName", function( l, ply )
    
			itemlist:AddLine( net.ReadString(), 1 )

		end )
	end
	
	usermessage.Hook( "AddItem", AddItem )

Any help is appreciated

I sent you how to use net messages - read it.

Explain to me how I didn’t use them correctly please, the wiki isn’t very specific

[editline]29th April 2016[/editline]

Thanks for the dumb tag, that was pretty helpful. :goodjob:

[editline]29th April 2016[/editline]

Turns out ent:GetName() is showing up blank, any fix?