Exports
Server and Client side exports for your other scripts
Last updated
Was this helpful?
Server and Client side exports for your other scripts
Last updated
Was this helpful?
Was this helpful?
SetPlayerDuty(source: number, value: boolean|string|nil): void
Sets the duty status for a player.
Parameters
source
(number
): The player's server ID.
value
(boolean|string|nil
):
true
— Puts the player on duty.
false
— Takes the player off duty.
string
— Represents a region (for regional duty).
nil
— Toggles the current duty status.
Behavior
If duty is toggled on and the society has regional duty enabled, it will prompt the client to select a region.
Sends a Discord webhook for status changes.
Example
SetPlayerDuty(23, true)
SetPlayerDuty(23, false)
SetPlayerDuty(23, nil)
SetPlayerDuty(23, "Valentine")
IsPlayerOnDuty(source: number): boolean, string|nil, any
Checks if a player is currently on duty.
Parameters
source
(number
): The player's server ID.
Returns
boolean
: Whether the player is on duty.
string|nil
: The job name (if on duty).
any
: Region or associated duty value.
Example
local isOnDuty, job, region = IsPlayerOnDuty(23)
print(isOnDuty, job, region)
Output
true "police" "Valentine"
GetPlayersOnDuty(society: string, aslist: boolean, region?: string): table
Returns a list or map of players currently on duty.
Parameters
society
(string
)
aslist
(boolean
)
region
(string
, optional)
Returns
table
: List or map of players on duty.
Examples
-- Flat list
local policeOnDuty = GetPlayersOnDuty("police", true)
print(json.encode(policeOnDuty))
Output:
{ 12, 33, 45 }
-- Filtered by region
local valentinePolice = GetPlayersOnDuty("police", true, "Valentine")
print(json.encode(valentinePolice))
Output:
{ 12, 33 }
-- Map with region
local detailedDutyMap = GetPlayersOnDuty("police", false)
print(json.encode(detailedDutyMap))
Output:
{
["12"] = "Valentine",
["33"] = "Valentine",
["45"] = "Rhodes"
}
IsBoss(society: string, grade: number|string): boolean
Checks if the given grade in a society is a boss.
Example
local isBoss = IsBoss("police", 4)
print(isBoss)
Output:
true
IsRecrank(society: string, grade: number|string): boolean
Checks if the grade is a "recruit rank" or boss.
Example
local isRecruitOrBoss = IsRecrank("sheriff", 0)
print(isRecruitOrBoss)
Output:
true
SocietyMoneyAdd(society: string, amount: number): boolean
Adds money to the society account.
Example
local success = SocietyMoneyAdd("lawman", 500)
print(success)
Output:
true
SocietyMoney(society: string): number|boolean
Gets current society account balance.
Example
local money = SocietyMoney("doctor")
print(money)
Output:
1500