Count PlayersOnscreen
#81
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