Tween script not working

im making a simple tween script that takes a frame and tweens it’s position, but its not working. here’s my code:

-- Variables --
local player = game.Players.LocalPlayer
local playerGui = game:GetService('Players').LocalPlayer:WaitForChild('PlayerGui')
local CHAT = game:GetService("Chat")
local Start = script.Parent.Start
local End = script.Parent.End
wait(5)
local questions = playerGui.V3.Questions:GetChildren()
local Fader = playerV3.Fader

-- Setup --
local q = {}
for i=1,#questions do
			table.insert(q, questions[i])
end

-- Start --
Start.B1.MouseButton1Click:Connect(function()
	Fader:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quad", 0.5, true)
	wait(0.5)
	Fader:TweenPosition(UDim2.new(0,0,1,0), "Out", "Quad", 0.5, true)
	Start.Visible = false
	q[2].Visible = true
end)

-- Main --
for i=2, #q do
	q[i].TextBox.FocusLost:Connect(function()
		local message = q[i].TextBox.Text
		local filteredMessage = CHAT:FilterStringForBroadcast(message, player)
		q[i].TextBox.Text = filteredMessage
	end)
	q[i].B1.MouseButton1Click:Connect(function()
		Fader:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quad", 0.5, true)
		wait(0.5)
		Fader:TweenPosition(UDim2.new(0,0,1,0), "Out", "Quad", 0.5, true)
		q[i + 1].Visible = true
		q[i].Visible = false
	end)
	q[i].B2.MouseButton1Click:Connect(function()
		Fader:TweenPosition(UDim2.new(0,0,0,0), "Out", "Quad", 0.5, true)
		wait(0.5)
		Fader:TweenPosition(UDim2.new(0,0,1,0), "Out", "Quad", 0.5, true)
		if q[i].Name == 'F1' then
		Start.Visible = true
			q[i].Visible = false
		else
			q[i - 1].Visible = true
			q[i].Visible = false
		end
	end)

	q[i].B3.MouseButton1Click:Connect(function()
		q[i].TextBox.Text = ""
	end)
end

any idea why?

Could you be more specific as to what is not working?

the tween isn’t playing at all.

I think you meant to say:

local Fader = player.playerGui.V3.Fader

Hope that helps!

fixed that, and its still not playing.

its playing for the start, but not for the rest.

im thinking it might be because of the for loop

put a print statement at the top of the for loop to see if it’s working and for how long

Maybe. Try wrapping the loop in a coroutine.

ah. It stops after a couple seconds. let me try and fix that and then see

just remove the for loop then

why do you have it there?

because it needs to loop over a certain amount of questions

im making an application, and it runs for the number of questions

even without the for loop it still won’t work, and there are no errors in console

nevermind. turns out the frame was just behind another one so it couldn’t be seen. all I had to do was change the zindex.

silly me