There is nothing inside of this folder. Why is it not playing the tween?

Hello! I hope you are having a great day!


I have a little problem. The Tween is not playing when there is nothing in the folder.

The Code:

	for i, v in pairs(script.Parent.Holder:GetChildren()) do
		if not v then
			ts:Create(script.Parent.Faded, tweenInfoOutFrame, goalOutFrame):Play()
		end
	end

The Tween Info and End Goal:

local goalOutFrame = {}
goalOutFrame.BackgroundTransparency = 1
local tweenInfoOutFrame = TweenInfo.new(0.5, Enum.EasingStyle.Sine, Enum.EasingDirection.In, 0, false)

What I tried before:

	for i, v in pairs(script.Parent.Holder:GetChildren()) do
		if v == nil then
			ts:Create(script.Parent.Faded, tweenInfoOutFrame, goalOutFrame):Play()
		end
	end

If you can help, please let me know. Thanks! WE

1 Like

Hello!
The problem with your script is that you need to have an item for the for table loop to work.
If you want to still get the same effect, try this

if #script.Parent.Holder:GetChildren() < 1 then
    --create tween here
end

Hope this helps!

2 Likes