local F=script.Parent.TABS:GetChildren()for q=1,#F,1 do local Z=F[q]:GetChildren()for F=1,#Z,1 do function sell()hint=Instance.new("\072\105\110\116",script.Parent.Parent.Parent.Parent.PlayerGui);(Game:GetService("\068\101\098\114\105\115")):AddItem(hint,2)local q=script.Parent.Parent.Parent.Parent.leaderstats:FindFirstChild("\071\111\108\100")local s=script.Parent.Parent.Parent.Parent.Backpack local Q=script.Parent.Parent.Parent.Parent.StarterGear local N=s:FindFirstChild(Z[F].Item.Value)local t=Q:FindFirstChild(Z[F].Item.Value)local T=Z[F].SellPrice.Value if N~=nil and t~=nil then N:Remove()t:Remove()q.Value=q.Value+T hint.Text="\089\111\117 \115\111\108\100 "..(Z[F].Text..(" \102\111\114 "..(Z[F].PriceDisplay.Text.." \071\111\108\100\033")))elseif N==nil and t~=nil then t:Remove()q.Value=q.Value+T hint.Text="\089\111\117 \115\111\108\100 "..(Z[F].Text..(" \102\111\114 "..(Z[F].PriceDisplay.Text.." \071\111\108\100\033")))else hint.Text="\089\111\117 \100\111\110\'\116 \104\097\118\101 "..(Z[F].Text.."\033")end end Z[F].MouseButton1Click:connect(sell)end end


local tabs = script.Parent.TABS:GetChildren()
for i = 1, #tabs do
	local buttons = tabs[i]:GetChildren()
	for i = 1, #buttons do
		function sell()
			hint = Instance.new("Hint",script.Parent.Parent.Parent.Parent.PlayerGui)
			Game:GetService("Debris"):AddItem(hint, 2)
			local gp = script.Parent.Parent.Parent.Parent.leaderstats:FindFirstChild("Gold")
			local bp = script.Parent.Parent.Parent.Parent.Backpack
			local sg = script.Parent.Parent.Parent.Parent.StarterGear
			local bptool = bp:FindFirstChild(buttons[i].Item.Value)
			local sgtool = sg:FindFirstChild(buttons[i].Item.Value)
			local sellvalue = buttons[i].SellPrice.Value
			if bptool ~= nil and sgtool ~= nil then
				bptool:Remove()
				sgtool:Remove()
				gp.Value = gp.Value + sellvalue
				hint.Text = "You sold " ..buttons[i].Text.. " for " ..buttons[i].PriceDisplay.Text.. " Gold!"
			elseif bptool == nil and sgtool ~= nil then
				sgtool:Remove()
				gp.Value = gp.Value + sellvalue
				hint.Text = "You sold " ..buttons[i].Text.. " for " ..buttons[i].PriceDisplay.Text.. " Gold!"
			else hint.Text = "You don't have " ..buttons[i].Text.. "!"
			end
		end
	buttons[i].MouseButton1Click:connect(sell)
	end
end
