How to correct this loop problem?

Basically am cloning a frame on a gui where inside the frame there is the player’s thumbnail and his name, but what happens is if there are two players in that player table (which is basically the players sent from the server that are playing in game), the frame cloned are two of the same person and two of the other person how can I correct this? I have identified that the problem is because it iterates twice, so how can I alternatively make it work or something?

The code

meetArgs.OnClientEvent:Connect(function(plrTab)
	local thumbType = Enum.ThumbnailType.HeadShot
	local thumbSize = Enum.ThumbnailSize.Size100x100
	for i, plr in pairs(plrTab) do
	local clone = frame:Clone()
	local id = plr.UserId
	local shot = players:GetUserThumbnailAsync(id, thumbType, thumbSize)
	clone.UserThumb.Image = shot
	clone.Username.Text = plr.Name
	clone.Parent = script.Parent.Screen
	script.Parent.Visible = true
	script.Parent.Time.TimeScript.Disabled = false
	end
end)
1 Like

node_modules1, try adding an if statement after the for loop to check if the players’ user id is equal to the same id.

1 Like

An if not statement or just an if statement?

Just an if statement, to check that the user id of that particular player is the same player

1 Like

Well, I hope you’ll be able to fix your problem as I acquire sleep now. Gn

Ah okay, but it didn’t work, can’t find a solution for it.