derma list view not working with a table. other players can't see it.

so, I’m trying to make a thing where, when a player clicks “complete form” it adds a thing to a table. but when another player opens it and looks at the list, there’s nothing but his/her stuff there. any suggestions?
code: (shared btw)
[lua] local PlayerShop = vgui.Create( “DPanel” )

DermaListView = vgui.Create("DListView",PlayerShop)

for k,v in pairs(Sales) do 

local Sell = vgui.Create("DPanel")

local WangLabel = vgui.Create("DLabel", Sell)
local Wang = vgui.Create( "DNumberWang", Sell )
Wang:SetPos( 50, 50 )

local Text = vgui.Create("DTextEntry", Sell)

local button2 = vgui.Create( "DButton", Sell )
	button2:SetSize( 150, 50 )
	button2:SetPos( 50, 200 )
	button2:SetText( "Complete Form" )
	button2:SetParent( Sell )
	button2.DoClick = function( button2 )
		surface.PlaySound( "ui/buttonclickrelease.wav" )
		table.insert( Sales, { Item = Text:GetValue(), Seller = LocalPlayer():Nick(), Price = math.Round(Wang:GetValue()) } ) 

I have a table at the top called “Sales”

That is because your Sales table is clientside.
The client in the client-side Lua instance inserts something into the client version of the Sales table. It does not automatically transfer between clients.
Rather, you have to use something like concommands to register when a client has bought something.

I’m not really checking if a player bought something, it’s just to show what people have to sell. do tables work if I were to make a table on the server then use it on the client?

If you make a table on the server, it is only available on the server.
If you make a table on the client, it is only available on the client.
If you make a table in a shared file, it will make two tables, one on the server and one on the client. Changing one does not affect the other.
Traditionally, you use concommands when you want to communicate information from client to server.

so, I just make a simple concommand and make it use table.insert to insert my stuff I’m selling into the table?


something like this perhaps?
if a[1] and a[2] and a[3] then
table.insert( Sales, { Item = a[1], Seller = a[2], Price = a[3] } )

Yeah, that would work.

Bear in mind though, if your item’s name is “My Item of Awesome” then I think it would parse that as four arguments.

is there any way I can counteract this?

Rather than identifying items by name, you could assign each item a numeric id. Numbers are nice because they can always be passed as one argument.

how would I do that? could you give me an example?