Hello there!
So I have this little piece of script right here, which is supposed to choose from a folder a random player inside.
I’ve put 3 models inside the folder for testing the script( “Player1”, “Player2” and “Player3”).
Here’s a photo by any chance:

The problem is that when any of my test model is chosen, it prints perfectly fine.
But when it picks my character, it prints me out “nil”.
Here’s the code:
local k = math.random(1,#plrsInLobby_Folder:GetChildren())
local chosenK = plrsInLobbyTable[k]
print(chosenK,k) -- "ChosenK" it's the name/value , and "k" is the number/index.
Here’s what it prints when a test model is chosen:
![]()
And here’s what it prints when my character is chosen:
![]()
I’ve tried a lot of things trying to solve it, so I would apreciate any answer.
I hope I don’t look dumb if it’s an obvious solution for this.
Thank you!