Exports
Server Exports
GetJobCounts
Returns a table of all jobs with their current online player count.
| Property | Value |
|---|---|
| Side | Server |
| Returns | table — { 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')
endLast updated on