List not working correctly

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? I want my list to NOT keep making its way down the side of the screen. I want it all to stay in the same spot (top left corner of the screen) and look like an actual list that updates.

  2. What is the issue? My script keeps making my list move down the screen slowly.

  3. What solutions have you tried so far? I have tried revamping it many times and I have tried to get it to function correctly different ways.

IN A LOCAL SCRIPT:

wait(2)
print("Staarting")
--LocalScript.

local newfolder = Instance.new("Folder")
newfolder.Name = "Input"
newfolder.Parent = script.Parent


newfolder.DescendantAdded:Connect(function(obj)
	
	if #newfolder:GetChildren() > 5 then --fix the damn position.
		
		local one = newfolder:FindFirstChild("1")
		local two = newfolder:FindFirstChild("2") --we are gonna need the second chat label as well
		
		two:TweenPosition(UDim2.new(0.02,0,0.06,0), "Out", "Quint") --slide the label to the correct spot in the chat frame.
		one:Destroy() --destroy the first one
		
		for nam,obj in pairs(newfolder:GetChildren()) do --get the rest of the main folder
			obj.Name = nam --re-number everthing
		end
	end
		
	for i = 1, #newfolder:GetChildren(), 1 do --Get the children of the main folder.
		local label1 = newfolder:FindFirstChild(tostring(i))
		
		if i == 1 then
			local homePos = UDim2.new(0.02,0,0.06,0) --Starting position 1 for the first chat message.	
			if label1.Position ~= homePos then
				label1.Position = homePos
			end
		else
			local label2 = newfolder:FindFirstChild(tostring(i-1)) --find the pervious label
			
			if label2 ~= nil then
				local Line2 = label2:FindFirstChild("Line2") --
				
				if Line2 then --IF the second line is visible then
					label1:TweenPosition(UDim2.new(label2.Position.X.Scale, label2.Position.X.Offset, label2.Position.Y.Scale + 0.08, label2.Position.Y.Offset), "Out", "Quint") --slide the label to the correct spot in the chat frame.
				else --elsee
					label1:TweenPosition(UDim2.new(label2.Position.X.Scale, label2.Position.X.Offset, label2.Position.Y.Scale + 0.07, label2.Position.Y.Offset), "Out", "Quint") --slide the label to the correct spot in the chat frame.
				end
			end
			
		end
		
		
	end
end)


local pos = 0;
while true do
	wait(3)
	pos = pos + 1
	local newLabel = Instance.new("TextLabel")
	newLabel.Name = tostring(pos)
	newLabel.Text = tostring(pos)
	newLabel.Size = UDim2.new(0.1,0,0.03,0)
	newLabel.Position = UDim2.new(0.02,0,0.06,0)
	
	local line2Chance = math.random(1,2)
	if line2Chance == 2 then
		local line2 = Instance.new("TextLabel")
		line2.Name = "Line2"
		line2.Position = UDim2.new(0.5, 0, 1.03, 0)
		line2.Size = UDim2.new(0.1,0,0.03,0)
		line2.Visible = true
		line2.Text = "99"
		line2.Parent = newLabel
	end
	
	
	newLabel.Parent = newfolder

end

How can I make this work correctly. It keeps doing this dumb crap:
Label Test.rbxl (24.3 KB)

??? What type of list, do you want to make, I cant tell from your code.

It is supposed to be a chat list. If you test it, you will see that it keeps moving down the side of the screen. I just want it to update like a normal chat gui.

Ah, best thing to do here would be to use a scrolling frame.

Well, how can I fix it without a scrolling frame? I don’t want to use a scrolling frame.

I don’t think theres a way to fix this without using a scrolling frame.

But my script is performing the task already. The movement between the text labels are getting messed up

it has something to do with:

	if Line2 then --IF the second line is visible then
					label1:TweenPosition(UDim2.new(label2.Position.X.Scale, label2.Position.X.Offset, label2.Position.Y.Scale + 0.08, label2.Position.Y.Offset), "Out", "Quint") --slide the label to the correct spot in the chat frame.
				else --elsee
					label1:TweenPosition(UDim2.new(label2.Position.X.Scale, label2.Position.X.Offset, label2.Position.Y.Scale + 0.07, label2.Position.Y.Offset), "Out", "Quint") --slide the label to the correct spot in the chat frame.
				end

Well, if you use tweening some bugs can happen with tweens. But I think if might be because u need a scrolling frame for chat and add a UIListLayout inside the scrolling frame. And if you have a script then just add a variable for the scrolling frame and use the variable. (If you have a variable for the frame just add the scrolling frame to it)

My problem was actually the tweens. I took it out and switched it so the position would just get set directly without any tweening and it worked to how I wanted it.