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") end
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 )