I've been stuck on this for about 20 minutes and for some reason it doesn't run the same amount of times as there are players.
for i = 1, #game:GetService("Players"):GetPlayers() do
local Sam = SERVERQBA:Clone()
Sam.Name = i
Sam.Parent = SERVERQBAT
Sam.LayoutOrder = i
SERVERQBAT.CanvasSize = UDim2.new(0, 0, 0, 50 * i)
end

10 comments
Can we see the full script and if there are any errors? It is hard to help without much context.
I don't really see a need for that as I know 100% that's what is causing this. I replaced the #game:GetService("Players"):GetPlayers() with 10 and it repeated i 10 times. It's a local script in a gui, and the GUI is in StarterGui. Feel like thats a fair amount of information.
When does this script run? What is the loop doing? Sometimes the problem is not always right in front of you.
There you go, edited.
Have you tried printing the value of #game:GetService("Players"):GetPlayers() before the loop to find out the actual amount?
No, I'll do that rn
if #game:GetService("Players"):GetPlayers() equal to 0 this loop will not loop, that's why, there are peobarely no players i think
But starmaq if there is no players, then how he knows if that's working? He can only know by joining to the game..
The script might have ran before the player object was even added.
-1 Use a title that explains your question