PlayerList UI Error

Hi, I am trying to create a UI list after each list, however, each frame isn’t having each different user, instead, it has the same user. See image below:
image

How do I fix this? Here is my RemoteEvent script:

game.ReplicatedStorage.Events.FinalPlayerList.OnClientEvent:Connect(function()
	for i, v in pairs(game.Players:GetPlayers()) do
		local Position = v:FindFirstChild("CurrentPositionNumber")
		if tonumber(Position.Value) == 1 then
			local PlaceFrame = UIListTemplate:Clone()
			
			PlaceFrame.PlayerImage.Image = game.Players:GetUserThumbnailAsync(v.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
			PlaceFrame.Username.Text = v.Name
			PlaceFrame.Parent = Frame
			
		end
		if tonumber(Position.Value) == 2 then
			local PlaceFrame = UIListTemplate:Clone()
			
			PlaceFrame.PlayerImage.Image = game.Players:GetUserThumbnailAsync(v.UserId, Enum.ThumbnailType.HeadShot, Enum.ThumbnailSize.Size420x420)
			PlaceFrame.PositionImage.Image = Second
			PlaceFrame.Username.Text = v.Name
			PlaceFrame.Parent = Frame
			
		end
	end 
	
	
end)
1 Like

I tried removing the for loop, yet it didn’t change anything? Do I need to do anything else because I clearly need to?

1 Like

Try adding an elseif instead of another if statement. Also, try making the templates have different names?

If not, maybe try sending the player argument in the remote event

1 Like

You can add:

PlaceFrame.LayoutOrder = 1

To place the frame at the top.

1 Like

Oh yes! I was going to ask about that too! Thank you!

That didn’t work. Still caused the same result, instead, it just kept the same image of the position.

I’m going to try to create string values in ReplicatedStorage and in each string file, the value will either have the Username or UserId. Then, I’ll have the remote event loop through, if it’s null, it won’t create the frame. I’ll see how that goes.

1 Like

Hmmm. Could you post the full script? Specifically the one which puts players in order.

1 Like

That didn’t work, it couldn’t send the data over for some reason. Does anyone know any alternatives or articles I can look into?