When I click the button that should send these items to another frame, only some of the cards are sent and the frames' positions are not 'tweened':

script.Parent.Parent.Parent:TweenPosition(UDim2.new(-0.6,0,0.275,0))
script.Parent.Parent.Parent.Parent.PacksMenu:TweenPosition(UDim2.new(0.2,0,0.275,0))

The output says that "the function is not yet enabled, though in another script, (the one that opens the card pack,) it is enabled. The output also says that there is a problem with this line after the pack is opened the second time:

Images[i].Image = "http://www.roblox.com/asset/?id=272990969"

Can someone help me out? I don't know what is going on here.

Cards = script.Parent.Parent.Parent.Parent.MyCardsMenu.Cards
c = Cards:GetChildren()
Cards1 = Cards.Parent.Cards1
f = Cards1:GetChildren()
Images = {script.Parent.Parent.Parent.CardBackground1.Card1, script.Parent.Parent.Parent.CardBackground2.Card2, script.Parent.Parent.Parent.CardBackground3.Card3, script.Parent.Parent.Parent.CardBackground4.Card4, script.Parent.Parent.Parent.CardBackground5.Card5, script.Parent.Parent.Parent.CardBackground6.Card6}
a = 1

for i = 1, #c do
	if Cards["Card".. i].Image == "" and a < 6 then
		Cards["Card".. i].Image = Images[a].Image
		Images[i].Image = "http://www.roblox.com/asset/?id=272990969"
		a = a+1
		script.Parent.Parent.Parent:TweenPosition(UDim2.new(-0.6,0,0.275,0))
		script.Parent.Parent.Parent.Parent.PacksMenu:TweenPosition(UDim2.new(0.2,0,0.275,0))
	end
end
if a < 6 then
	for i = 1, #f do
		if Cards1["Card".. i].Image == "" and a < 6 then
		Cards["Card".. i].Image = Images[a].Image
		Images[i].Image = "http://www.roblox.com/asset/?id=272990969"
		a = a+1
		script.Parent.Parent.Parent:TweenPosition(UDim2.new(-0.6,0,0.275,0))
		script.Parent.Parent.Parent.Parent.PacksMenu:TweenPosition(UDim2.new(0.2,0,0.275,0))
		end
	end
end

wait(0.5)
script.Disabled = true

The script is meant to send these images to another frame, with 10 cards on only two pages, with six cards in each packs. The script should make it so that it does not replace the cards, and that when a second pack is opened, the remaining four spots are filled on the first page and the first two spots are filled on the second page.

1 comment

2

so there's at least 4 problems you're having with this - Tweening, function not enabled, a reference error to Images[i], and the need for a function (it looks like) to handle getting cards organized amongst 2 pages (frames) with a 4 card limit, and max limit of cards being 10. Correct?