Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

I need help with this playerlist GUI, the positioning isn't working correctly?

I need some help, I'm working on a PlayerList GUI, and everything perfect except one thing... the positioning. I have everythhing aligned but for some reason everytime a new player joins, the playerlist decides to overlap it with the other player This is the coding, the playerlist doesn't move any of the children. See the demonstration here!- https://www.roblox.com/games/553592172/AB-ABSOLUTE-HOLO-AB

Pos = 0

function upd()

	getall = PL:GetChildren()
	
	for i=1, #getall do
		getall[i].Position = UDim2.new(0, 0, 0, Pos)
		PL.CanvasSize = UDim2.new(0, 0, 0, Pos)
		Pos = Pos + 25
	end
	Pos = 0
end


1 comment

0

You never called the function in any way, shape, or form

1 answer

Instead of doing a for loop like that, do one where it grabs the players instead. In this case, you would use `````pairs` In doing this, it grabs all the children into a easily accessible variable that change each time it iterates. To do this, I would usually do something like,

for _, v in pairs(PL:GetChildren()) do -- v is the child that switches each time
	PL.CanvasSize = UDim2.new(0,0,0,Pos) -- Just in case the CanvasSize being last is the problem, which most likely isn't.
	v.Position = UDim2.new(0,0,0,Pos)
	Pos = Pos + 25
end

This discussion is preserved as it was. New answers, comments, and votes are closed.