Finding players

Whats wrong with this code?


	local players = player.GetAll()
	for k, v in pairs(players) do
		if v:IsAdmin() or v:IsSuperAdmin() then
			v:ChatPrint(player:Nick())
		end
	end

player isn’t defined as something you could print. It’s currently a table (the player library)

-snip-

Server

v:ChatPrint(player:Nick())

Oh right, I didn’t see that before. player should be v.

I get this error :



<snip>.lua:8: attempt to call field 'GetAll' (a nil value)


and this is the line



	local players = player.GetAll()


Sounds like you overwrote the player library.