Author Topic: API: Server():getPlayers() returns 0 players  (Read 13 times)

Rinart73

  • Full Member
  • ***
  • Status:
    Offline
    Posts:
    175
  • Discord: Rinart73#7304
    • View Profile
on: August 13, 2018, 02:20:48 AM
0.18.2 - r12552, Windows 10 x64

I'm in the singleplayer game.
I add some code to the "data/scripts/server/server.lua" file, at the end of "update" function:
Code: [Select]
local players = {Server():getPlayers()}
print("#players = ", #players)
local playersOnline = {Server():getOnlinePlayers()}
print("#playersOnline = ", #playersOnline)

In the first case I get 0, in the second - 1. So I guess something is wrong with the "Server():getPlayers()" function?