Type Function Return value Boolean Revision Current Public Release (2018.3326) Keywords steam, steamworks, requestActivePlayerCount See also activePlayerCount steamworks.*
Asynchronously fetches the number of people running the application globally from Steam's server, not counting the currently logged in user.
true if the request was successfully sent to Steam. Note that this does not necessarily mean that the requested operation will succeed. For example, this function will return
true if there is no Internet connection. So, the listener must check the received event.isError property to determine if the requested operation succeeded.
false if given invalid arguments or if the steamworks.isLoggedOn property is
steamworks.requestActivePlayerCount( listener )
local steamworks = require( "plugin.steamworks" ) -- Fetch the number of people currently playing this game local function onReceivedActivePlayerCount( event ) if ( event.isError ) then -- This will likely happen due to lack of Internet access print( "Failed to fetch active player count." ) else -- Print current number of people playing this game print( "Active Player Count: " .. tostring(event.count) ) end end steamworks.requestActivePlayerCount( onReceivedActivePlayerCount )