πExports & Usage
Dynyx Prison includes a set of exports that let developers interact with the system from other scripts. These exports allow jail logic, sentence modification, community service, and UI actions to be t
π₯οΈ Server Exports
These exports should be used from server-side scripts only.
π AddPrisonerExternally Jails a player and adds them to the prison system.
exports['dynyx_prison']:AddPrisonerExternally(serverId, sentence, charges, lifer, serviceType, previousSentence, fine)
Parameters:
serverId
(number) β Playerβs server IDsentence
(number) β Sentence length in monthscharges
(table/string) β List or string of chargeslifer
(boolean) β Whether the player is a liferserviceType
(string) β"prison"
or"community_service"
previousSentence
(number, optional) β For sentence stackingfine
(number, optional) β Optional fine to apply
π ReleasePrisonerExternally Releases a prisoner or marks them as escaped.
exports['dynyx_prison']:ReleasePrisonerExternally(citizenid, jailbreak)
Parameters:
citizenid
(string) β Playerβs unique identifierjailbreak
(boolean) βtrue
if escaped,false
if released normally
βοΈ ModifyPrisonerSentenceExternally Sets a new sentence time for a prisoner.
exports['dynyx_prison']:ModifyPrisonerSentenceExternally(citizenid, newTime)
Parameters:
citizenid
(string) β Playerβs unique identifiernewTime
(number) β New sentence time in months
π GetRemainingPrisonSentence Returns the current time remaining for a prisoner.
local time = exports['dynyx_prison']:GetRemainingPrisonSentence(citizenid)
Returns:
(number) Time remaining in months
0
if prisoner not found
β IsPlayerJailed Checks if a player is currently serving a prison sentence.
local jailed = exports['dynyx_prison']:IsPlayerJailed(citizenid)
Returns:
(boolean)
true
if jailed,false
if not
π οΈ IsPlayerCommunityService Checks if a player is currently serving community service.
local comserv = exports['dynyx_prison']:IsPlayerCommunityService(citizenid)
Returns:
(boolean)
true
if serving community service,false
if not
π¨ IsPlayerEscaped (new) Checks if a player has escaped from prison.
local escaped = exports['dynyx_prison']:IsPlayerEscaped(citizenid)
Returns:
(boolean)
true
if escaped,false
if not
π§βπ» Client Exports
These can be used from client-side scripts.
π OpenPrisonManageUI Opens the prison staff UI to view or manage prisoners.
exports['dynyx_prison']:OpenPrisonManageUI()
Requires the player to have a valid staff job.
π¨ OpenPrisonJobsUI Opens the inmate job selection UI.
exports['dynyx_prison']:OpenPrisonJobsUI()
π‘ Tips
You can use these in custom commands, MDTs, police scripts, admin menus, or integrated job systems.
All server-side exports use live data β no need to restart the script after changes.
Last updated