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)
DermaListView:SetParent(PlayerShop)
DermaListView:SetPos(0,25)
DermaListView:SetSize(450,450)
DermaListView:SetMultiSelect(false)
DermaListView:AddColumn("Item")
DermaListView:AddColumn("Seller")
DermaListView:AddColumn("Price")
for k,v in pairs(Sales) do
DermaListView:AddLine(v.Item,v.Seller,v.Price)
end
local Sell = vgui.Create("DPanel")
local WangLabel = vgui.Create("DLabel", Sell)
WangLabel:SetText("Price")
WangLabel:SetPos(50,35)
local Wang = vgui.Create( "DNumberWang", Sell )
Wang:SetPos( 50, 50 )
local Text = vgui.Create("DTextEntry", Sell)
Text:SetText("Object")
Text:SetPos(50,100)
Text:SizeToContents()
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()) } )
end[/lua]
I have a table at the top called “Sales”