shop=game.ServerStorage:findFirstChild(script.Parent.Name)gui=script.Parent.CenterFrame.Shop gui.Header.Text=script.Parent.Name items=shop:GetChildren()xv=0 yv=0 for H,J in pairs(items)do if J.className=="\077\111\100\101\108"then local H=gui.Items.BaseButton:clone()H.Parent=gui.Items H.Name=J.Name H.Image="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061"..J.DecalID.Value H.Position=UDim2.new(0,xv*80,0,yv*80)xv=xv+1 if xv==4 then xv=0 yv=yv+1 end local V=J.ItemDesc:clone()V.Parent=H local i=J.ItemCost:clone()i.Parent=H H.Visible=true end end script.Parent.CenterFrame:TweenPosition(UDim2.new(.5,0,.5,0),"\079\117\116","\081\117\097\100",.2,true)


shop = game.ServerStorage:findFirstChild(script.Parent.Name)
gui = script.Parent.CenterFrame.Shop

gui.Header.Text = script.Parent.Name

items = shop:GetChildren()

xv = 0
yv = 0

for i,v in pairs(items) do
	if v.className == "Model" then
		local button = gui.Items.BaseButton:clone() --make new button for each item
		button.Parent = gui.Items
		button.Name = v.Name
		button.Image = "http://www.roblox.com/asset/?id="..v.DecalID.Value
		button.Position = UDim2.new(0, xv*80, 0, yv*80)
		xv = xv + 1
		if xv == 4 then
			xv = 0
			yv = yv + 1
		end
		local desc = v.ItemDesc:clone() --place the item desc into the button
		desc.Parent = button
		local cost = v.ItemCost:clone()
		cost.Parent = button
		button.Visible = true
	end
end

script.Parent.CenterFrame:TweenPosition(UDim2.new(.5,0,.5,0), "Out", "Quad", .2, true)

