Skip to Content

Exports

Server Exports

GetJobCounts

Returns a table of all jobs with their current online player count.

PropertyValue
SideServer
Returnstable{ jobName = playerCount }

Usage

local jobCounts = exports['flux-job-selector']:GetJobCounts() -- Example return value: -- { -- police = 5, -- ambulance = 3, -- mechanic = 2, -- taxi = 1, -- } -- Get count for a specific job local policeCount = jobCounts['police'] or 0 print('Police online: ' .. policeCount)

Example: Display All Job Counts

local counts = exports['flux-job-selector']:GetJobCounts() for job, count in pairs(counts) do print(job .. ': ' .. count .. ' players') end
Last updated on