for S,G in pairs(script.Parent.ShopFrame.Boxes:GetChildren())do if G:IsA("\084\101\120\116\066\117\116\116\111\110")then G.MouseButton1Click:Connect(function()for S,G in pairs(script.Parent.ShopFrame.BoxContaining.Frame:GetChildren())do if G:IsA("\073\109\097\103\101\076\097\098\101\108")then G:Destroy()end end local S=game.ReplicatedStorage.Weapons:FindFirstChild(G.Parent.Weapon.Value)print(S.Name)print(G.Name)local E=S:FindFirstChild(G.Name)local F=E:GetChildren()if#F>0 then for S,G in pairs(F)do local E=Instance.new("\073\109\097\103\101\076\097\098\101\108")E.Parent=script.Parent.ShopFrame.BoxContaining.Frame E.Image=G.TextureId end end script.Parent.ShopFrame.BoxContaining.TextLabel.Text=E.Name.." \098\111\120 \099\111\110\116\097\105\110\115\058"script.Parent.ShopFrame.BoxContaining.Box.Value=E script.Parent.ShopFrame.BoxContaining.Visible=true script.Parent.ShopFrame.Boxes.Visible=false end)end end

for _,v in pairs(script.Parent.ShopFrame.Boxes:GetChildren()) do
	if v:IsA("TextButton") then
		v.MouseButton1Click:Connect(function()			
			---Clean
			for _,y in pairs(script.Parent.ShopFrame.BoxContaining.Frame:GetChildren()) do
				if y:IsA("ImageLabel") then
					y:Destroy()
				end
			end
			
			--Add
			local Weaponfolder = game.ReplicatedStorage.Weapons:FindFirstChild(v.Parent.Weapon.Value)
			print(Weaponfolder.Name)
			print(v.Name)
			local Boxfolder = Weaponfolder:FindFirstChild(v.Name)
			local Weapons = Boxfolder:GetChildren()
			if #Weapons > 0 then
				for _,y in pairs(Weapons) do
					local ImgFrame = Instance.new("ImageLabel")
					ImgFrame.Parent = script.Parent.ShopFrame.BoxContaining.Frame
					ImgFrame.Image = y.TextureId
				end
			end
			script.Parent.ShopFrame.BoxContaining.TextLabel.Text = (Boxfolder.Name).." box contains:"
			script.Parent.ShopFrame.BoxContaining.Box.Value = Boxfolder
			script.Parent.ShopFrame.BoxContaining.Visible = true
			script.Parent.ShopFrame.Boxes.Visible = false
		end)
	end
end
