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:
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)
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.