i am trying to make a frame with a list of the player names in it. since the max players is 20, there is 20 text labels named "P"..(Text label number)so like P1, P2,etc. i have a script to get the player names in the game, and set it to ONE of the text labels. instead, it sets a name to all of them. any help?
local frame = script.Parent while true do for i,b in pairs(game.Players:GetChildren()) do for i,v in pairs (frame:GetChildren()) do v.Text = b.Name end end wait(5) end
Your problem is that you have all of the frames going through the loop for each player.
What you need to do is instead is make it so only one of the frame's text is changed instead of cycling through all of them for each player
local frame = script.Parent while true do for i, b in pairs(game.Players:GetChildren()) do frame:GetChildren()[i].Text = b.Name --This makes sure each player name is set to it's own unique frame end wait(5) end