Player Functions
Functions available on the server player object. Use GetPlayer to retrieve the object.
GetPlayer
To first access the player functions, you need to get the player
source
Number
Source of the player
Money
AddMoney
Add money to the player in the selected place
type
String
Money type e.g. cash or bank
amount
Number
Amount to be added
reason
String
Reason (Shown on bank statements)
RemoveMoney
Remove money from the player in the selected place
type
String
Money type e.g. cash or bank
amount
Number
Amount to be removed
reason
String
Reason (Shown on bank statements)
Jobs
AddJob
Add a job to the player
job
String
The job to add to the player
grade
Number
The grade to set the player to. If not set will default to 1
RemoveJob
Remove a job to the player
job
String
The job to remove from the player
HasJob
Returns a bool indicating if the player (character) has the defined job. If a grade is also defined, it'll return a bool indicating if the player (character) has the defined job and grade. If the player (character) doesn't have the job (and optionally, the grade) then it'll return a second string value indicating if the mismatch is the defined job or grade
job
String
The job name that the player must have
grade
Number
The grade number that the player must have
HasGrade
Returns a bool indicating if the player (character) has the defined job and grade access
job
String
The job name that the player must have
grade
Number
The grade number that the player must have
maxGrade
Bool
This defines the grade floor and ceiling when checking for access
IsOnDuty
Returns either a bool or a string indicating if the player is on duty for any or the optionally defined job. If the player is on duty, it'll also return the grade level of the on-duty job
job
String
The job name that'll be used to check if the player is on duty
OnDutyBusiness
Returns either a bool or a string indicating if the player is on duty for a job that is a business
SetJobDuty
Returns a bool indicating if the player duty was set
job
String
The job to set duty for
onDuty
Bool
If the player should be set on duty
Items
AddItem
Add an item to the player's inventory
item
String
The item to add to the player
amount
Number
The amount of items to add
slot
Number
The specific slot to add the item to
info
Object
The info/metadata for the object
RemoveItem
Remove an item to the player's inventory
item
String
The item to remove from the player
amount
Number
The amount of items to remove
slot
Number
The specific slot to remove the item from
UpdateItemInfo
Update the metadata/info of a specific item
slot
Number
The slot to update
slotIndex
Number
The slot index to update
info
Object
The updated item metadata (full object)
HasItem
Returns a bool indicating if the player (character) has the defined item
name
String
The item name to check for
Crypto
AddCrypto
Add cryptocurrency to the player
crypto
String
Crypto key (See laptop/configCrypto.lua)
amount
Number
Amount to be added
RemoveCrypto
Remove cryptocurrency from the player
cryptoe
String
Crypto key (See laptop/configCrypto.lua)
amount
Number
Amount to be removed
Other
SetMetaData
Set metadata on the player object
metadataKey
String
The key to set within the player object
value
Any
The value to set
SetReputation
Set the rep value for a player. Will initialise at a value of 0 if it doesn't exist
rep
String
The rep to set
value
Any
The value to set
AddReputation
Adds the rep value to the existing rep for a player. Will initialise at a value of 0 if it doesn't exist
rep
String
The rep to add to
value
Any
The value to add
GetFullName
Returns the full name of the player character
Last updated