Player.GetAll() is a nil value?

Hi, I’m trying to pick two random players from the server using a concommand. After looking here, I figured out that using


was the option. So, I have this code in shared.lua (tried it in init.lua, also):

function GameStart(ply)
	pl1 = table.Random(ply.GetAll())
	pl2 = table.Random(ply.GetAll())
	print(pl1:Nick() .. " is the first random player")
	print(pl2:Nick() .. " is the second random player")

And it says that ply.GetAll() is nil value. Is there something I’m missing?

Here’s the ConCommand hook:

concommand.Add( "con_debug", GameStart )


player.GetAll(), it’s all case sensitive.

[editline]12th October 2013[/editline]

Not ply.GetAll() or Player.GetAll(), but player.GetAll()

Wow, that fixed it. Thanks a lot!