Your browser does not support JavaScript or its disabled!
Please turn it on, or be aware that some features on this website will not work correctly.
0.9K
Count PlayersOnscreen #81
349b | 13 lines.
function countPlayers()
  local playerCount = 0
  for _, creature in ipairs(getSpectators(pos(), false)) do
    if creature:isPlayer() and not creature:isLocalPlayer() then
      playerCount = playerCount +1
    end
  end
  return playerCount
end

macro(2000, "PlayeronScreen", function()
  say("players on screen:"..countPlayers())
end)

06 Mar 2022
Ads