Pointshop VGUI help

Ok so i tried updating the DPointshopItem.lua file inside pointshop-master/lua/vgui, and for some reason it will not save the lua file. The server being edited runs 24/7 on the multiplayer network. Does the server have to be down while implementing these changes? The only thing i did was make it so users could select a “Preview” option so they could preview a sound through the pointshop before they spent points on it. Any ideas? I can will try to answer questions in the most detailed way i can, so please feel free to ask if it will help you answer my question.

Thanks!

Live editing doesn’t work in PS, restart the server after making changes and rejoin.

Yeah i know that, ive added multiple items and stuff to the pointshop, but i have never edited the VGUI. Whenever i save the new DPointshopItem.lua file, it just acts like i never saved it. It just goes back to the original one. I dont know if this is just a freak thing or something im not doing right. And yeah i know im saving it, ive tried it about 50+ times.

[editline]8th October 2014[/editline]


local PANEL = {}


local adminicon = Material("icon16/shield.png")
local equippedicon = Material("icon16/eye.png")
local groupicon = Material("icon16/group.png")


local canbuycolor = Color(80, 138, 80, 255)
local cantbuycolor = Color(162, 60, 67, 255)
local ownedcolor = Color(80, 80, 158, 255)


function PANEL:Init()
	self.PaintTime = -1;
	self.Info = ""
	self.InfoHeight = 20
	self.InfoBar = 6
	self.PriceInfo = 0;
end


function PANEL:DoClick()
	local points = PS.Config.CalculateBuyPrice(LocalPlayer(), self.Data)
	
	if not LocalPlayer():PS_HasItem(self.Data.ID) and not LocalPlayer():PS_HasPoints(points) then
		notification.AddLegacy("You don't have enough points for this!", NOTIFY_GENERIC, 5)
	end


	local menu = DermaMenu(self)
	
	if LocalPlayer():PS_HasItem(self.Data.ID) then
		menu:AddOption('Sell', function()
			Derma_Query('Are you sure you want to sell ' .. self.Data.Name .. '?', 'Sell Item',
				'Yes', function() LocalPlayer():PS_SellItem(self.Data.ID) end,
				'No', function() end
			)
		end)
	elseif LocalPlayer():PS_HasPoints(points) then
		menu:AddOption('Buy', function()
			Derma_Query('Are you sure you want to buy ' .. self.Data.Name .. '?', 'Buy Item',
				'Yes', function() LocalPlayer():PS_BuyItem(self.Data.ID) end,
				'No', function() end
			)
		end)
	end
	
	if LocalPlayer():PS_HasItem(self.Data.ID) then
		menu:AddSpacer()
		
		if LocalPlayer():PS_HasItemEquipped(self.Data.ID) then
			menu:AddOption('Holster', function()
				LocalPlayer():PS_HolsterItem(self.Data.ID)
			end)
		else
			menu:AddOption('Equip', function()
				LocalPlayer():PS_EquipItem(self.Data.ID)
			end)
		end
		
		if LocalPlayer():PS_HasItemEquipped(self.Data.ID) and self.Data.Modify then
			menu:AddSpacer()
			
			menu:AddOption('Modify...', function()
				PS.Items[self.Data.ID]:Modify(LocalPlayer().PS_Items[self.Data.ID].Modifiers)
			end)
		end
	end


    if (self.Data.SoundEffect) then
        menu:AddOption("Preview", function()
            surface.PlaySound('alchttt/killtaunts/'..self.Data.SoundEffect)
        end);
    end


	menu:Open()
end


function PANEL:SetData(data)
	self.Data = data
	self.Info = data.Name
	
	if data.Model then
		local DModelPanel = vgui.Create('DModelPanel', self)
		DModelPanel:SetModel(data.Model)
		
		DModelPanel:Dock(FILL)
		
		if data.Skin then
			DModelPanel:SetSkin(data.Skin)
		end
		
		local PrevMins, PrevMaxs = DModelPanel.Entity:GetRenderBounds()
		DModelPanel:SetCamPos(PrevMins:Distance(PrevMaxs) * Vector(0.5, 0.5, 0.5))
		DModelPanel:SetLookAt((PrevMaxs + PrevMins) / 2)
		
		function DModelPanel:LayoutEntity(ent)
			if self:GetParent().Hovered then
				ent:SetAngles(Angle(0, ent:GetAngles().y + 2, 0))
			end
			
			local ITEM = PS.Items[data.ID]
			
			ITEM:ModifyClientsideModel(LocalPlayer(), ent, Vector(), Angle())
		end
		
		function DModelPanel:DoClick()
			self:GetParent():DoClick()
		end
		
		function DModelPanel:OnCursorEntered()
			self:GetParent():OnCursorEntered()
		end
		
		function DModelPanel:OnCursorExited()
			self:GetParent():OnCursorExited()
		end
		
		local oldPaint = DModelPanel.Paint
		
		function DModelPanel:Paint()
			local x, y = self:LocalToScreen( 0, 0 )
			local w, h = self:GetSize()
			 
			local sl, st, sr, sb = x, y, x + w, y + h
			 
			local p = self
			while p:GetParent() do
				p = p:GetParent()
				local pl, pt = p:LocalToScreen( 0, 0 )
				local pr, pb = pl + p:GetWide(), pt + p:GetTall()
				sl = sl < pl and pl or sl
				st = st < pt and pt or st
				sr = sr > pr and pr or sr
				sb = sb > pb and pb or sb
			end
			 
			render.SetScissorRect( sl, st, sr, sb, true )
				oldPaint(self)
			render.SetScissorRect( 0, 0, 0, 0, false )
		end
	else
		local DImageButton = vgui.Create('DImageButton', self)
		DImageButton:SetMaterial(data.Material)
		
		DImageButton:Dock(FILL)
		
		function DImageButton:DoClick()
			self:GetParent():DoClick()
		end
		
		function DImageButton:OnCursorEntered()
			self:GetParent():OnCursorEntered()
		end
		
		function DImageButton:OnCursorExited()
			self:GetParent():OnCursorExited()
		end
	end
	
	if self.Description then
		self:SetTooltip(data.Description)
	end
end


function PANEL:Paint()


	local points = PS.Config.CalculateBuyPrice(LocalPlayer(), self.Data)
	
	if LocalPlayer():PS_HasPoints(points) then
		self.BarColor = canbuycolor
	else
		self.BarColor = cantbuycolor
	end
	
	if LocalPlayer():PS_HasItem(self.Data.ID) then
		self.BarColor = ownedcolor
	end
	
	surface.SetDrawColor( Color( self.BarColor.r, self.BarColor.g, self.BarColor.b, self.BarColor.a + ( 255 * math.Clamp( self.PaintTime, -1, 0 ) ) ) )
	surface.DrawRect( 0, 0, self:GetTall(), self:GetWide() )


	draw.TexturedQuad
	{
		texture = surface.GetTextureID "gui/gradient",
		color = Color( 0, 0, 0, 60 + 60 * math.Clamp( self.PaintTime, -1, 0 ) ),
		x = 1,
		y = 1,
		w = self:GetWide() - 2,
		h = self:GetTall() - 2
	}
	
end


function PANEL:PaintOver()


	local alpha = 255 + 255 * math.Clamp( self.PaintTime, -1, 0 ) 


	if self.Data.AdminOnly then
		surface.SetMaterial(adminicon)
		surface.SetDrawColor(Color(255, 255, 255, alpha))
		surface.DrawTexturedRect(5, 5, 16, 16)
	end
	
	if LocalPlayer():PS_HasItemEquipped(self.Data.ID) then
		surface.SetMaterial(equippedicon)
		surface.SetDrawColor(Color(255, 255, 255, alpha))
		surface.DrawTexturedRect(self:GetWide() - 5 - 16, 5, 16, 16)
	end
	
	if self.Data.AllowedUserGroups and #self.Data.AllowedUserGroups > 0 then
		surface.SetMaterial(groupicon)
		surface.SetDrawColor(Color(255, 255, 255, alpha))
		surface.DrawTexturedRect(5, self:GetTall() - self.InfoHeight - 5 - 16, 16, 16)
	end
	
	local points = PS.Config.CalculateBuyPrice(LocalPlayer(), self.Data)
	
	self.BarColor = Color( 38, 41, 55, 255 )
	
	surface.SetDrawColor(self.BarColor)
	surface.DrawRect(0, self:GetTall() - self.InfoHeight, self:GetWide(), self.InfoHeight)
	
	if ( self.Hovered ) then
		surface.DrawRect( 0, 0, self:GetWide(), self.InfoBar )
		surface.DrawRect( 0, self.InfoBar, self.InfoBar, self:GetTall() - self.InfoBar - self.InfoHeight )
		surface.DrawRect( self:GetWide() - self.InfoBar, self.InfoBar, self.InfoBar, self:GetTall() - self.InfoBar - self.InfoHeight )
	end
	
	local txtColor = Color( 255, 255, 255, alpha )
	
	if self.PriceInfo > 0 then
		txtColor = Color( 96, 169, 23, alpha )
	elseif self.PriceInfo < 0 then
		txtColor = Color( 229, 20, 0, alpha )
	end
	
	draw.SimpleText(self.Info, "HudHintTextLarge", self:GetWide() / 2, self:GetTall() - (self.InfoHeight / 2), txtColor, TEXT_ALIGN_CENTER, TEXT_ALIGN_CENTER)
	
	if LocalPlayer().PS_Items and LocalPlayer().PS_Items[self.Data.ID] and LocalPlayer().PS_Items[self.Data.ID].Modifiers and LocalPlayer().PS_Items[self.Data.ID].Modifiers.color then
		surface.SetDrawColor(LocalPlayer().PS_Items[self.Data.ID].Modifiers.color)
		surface.DrawRect(self:GetWide() - 5 - 16, 26, 16, 16)
	end
end


function PANEL:OnCursorEntered()
	self.Hovered = true
	self.InfoHeight = 30;
	surface.PlaySound( "ambient/water/rain_drip4.wav" )
	
	if LocalPlayer():PS_HasItem(self.Data.ID) then
		self.Info = '+' .. PS.Config.CalculateSellPrice(LocalPlayer(), self.Data )  .. " PTs"
		self.PriceInfo = 1
	else
		self.Info = '-' .. PS.Config.CalculateBuyPrice(LocalPlayer(), self.Data ) .. " PTs" 
		self.PriceInfo = -1
	end
	
	PS:SetHoverItem(self.Data.ID)
end


function PANEL:Think()
	
	if self.PaintTime < 0 then
		self.PaintTime = self.PaintTime + FrameTime() * 2
	elseif self.PaintTime > 0 then
		self.PaintTime = 0
	end
	
end


function PANEL:OnCursorExited()
	self.Hovered = false
	self.InfoHeight = 20;
	self.Info = self.Data.Name
	self.PriceInfo = 0;
	
	PS:RemoveHoverItem()
end


vgui.Register('DPointShopItem', PANEL, 'DPanel')




ive posted the code to see if itll help, but i doubt it has any effect. the only line ive changed is


 if (self.Data.SoundEffect) then
        menu:AddOption("Preview", function()
            surface.PlaySound('alchttt/killtaunts/'..self.Data.SoundEffect)
        end);
    end

this is the preview ive added, thanks Nookyava for the help

[ERROR] addons/pointshop-master/lua/vgui/dpointshopmenu.lua:118: attempt to index local ‘model’ (a nil value)

  1. Init - addons/pointshop-master/lua/vgui/dpointshopmenu.lua:118
  2. Create - lua/includes/extensions/client/panel/scriptedpanels.lua:153
    3. ToggleMenu - addons/pointshop-master/lua/cl_pointshop.lua:13
    4. func - addons/pointshop-master/lua/cl_pointshop.lua:65
    5. unknown - lua/includes/modules/net.lua:32
    is what i got when i tried this