This documentation is for developers who are making scripts for VORP Core Framework
Export
GetCore is a shared export that returns the core table containing all the getters and setters for VORP Core.
some of the getters and setters are client side only and some are server side only.
The core table containing all the getters and setters.
local Core = exports . vorp_core : GetCore ()
Notifications
notifications can also accept -1 as duration to always stay on screen and to clear them you need to use UiFeedClearChannel
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeft ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyTip ( "title" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeft ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyRightTip ( "title" , 4000 )
The title of the notification
Core . NotifyObjective ( "title" , 4000 )
The title of the notification
Core . NotifyTop ( "title" , "location" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifySimpleTop ( "title" , "subtitle" , 4000 )
The title of the notification
The dictionary for the icon
Color of the notification
Core . NotifyAvanced ( "title" , "dict" , "icon" , "color" , 4000 )
The title of the notification
Core . NotifyCenter ( "title" , 4000 )
The title of the notification
Core . NotifyBottomRight ( "title" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyFail ( "title" , "subtitle" , 4000 )
The title of the notification
Core . NotifyDead ( "title" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyUpdate ( "title" , "subtitle" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyWarning ( "title" , "subtitle" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeftRank ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeft ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyTip ( "title" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeft ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyRightTip ( "title" , 4000 )
The title of the notification
Core . NotifyObjective ( "title" , 4000 )
The title of the notification
Core . NotifyTop ( "title" , "location" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifySimpleTop ( "title" , "subtitle" , 4000 )
The title of the notification
The dictionary for the icon
Color of the notification
Core . NotifyAvanced ( "title" , "dict" , "icon" , "color" , 4000 )
The title of the notification
Core . NotifyCenter ( "title" , 4000 )
The title of the notification
Core . NotifyBottomRight ( "title" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyFail ( "title" , "subtitle" , 4000 )
The title of the notification
Core . NotifyDead ( "title" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyUpdate ( "title" , "subtitle" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyWarning ( "title" , "subtitle" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeftRank ( "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyTip ( source , "title" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeft ( source , "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
The title of the notification
Core . NotifyRightTip ( source , "title" , 4000 )
The title of the notification
Core . NotifyObjective ( source , "title" , 4000 )
The title of the notification
Core . NotifyTop ( source , "title" , "location" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifySimpleTop ( source , "title" , "subtitle" , 4000 )
The title of the notification
The dictionary for the icon
Color of the notification
Core . NotifyAvanced ( source , "title" , "dict" , "icon" , "color" , 4000 )
The title of the notification
Core . NotifyCenter ( source , "title" , 4000 )
The title of the notification
Core . NotifyBottomRight ( source , "title" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyFail ( source , "title" , "subtitle" , 4000 )
The title of the notification
Core . NotifyDead ( source , "title" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyUpdate ( source , "title" , "subtitle" , 4000 )
The title of the notification
The subtitle of the notification
Core . NotifyWarning ( source , "title" , "subtitle" , "audioref" , "audioname" , 4000 )
The title of the notification
The subtitle of the notification
The dictionary for the icon
Color of the notification
Core . NotifyLeftRank ( source , "title" , "subtitle" , "dict" , "icon" , 4000 , "color" )
Characters
Get the character data to access getters and setters
local user = Core . getUser ( source ) --[[@as User]]
if not user then return end -- is player in session?
local character = user . getUsedCharacter --[[@as Character]]
The unique identifier of the character
local identifier = character . identifier
The unique character identifier
local charIdentifier = character . charIdentifier
The group the character belongs to
local group = character . group
local job = character . job
The job grade of the character
local jobGrade = character . jobGrade
The job label of the character
local jobLabel = character . jobLabel
The amount of money the character has
local money = character . money
The amount of gold the character has
local gold = character . gold
The amount of rol the character has
local rol = character . rol
The amount of experience points the character has
The first name of the character
local firstname = character . firstname
The last name of the character
local lastname = character . lastname
The status of the character
local status = character . status
The coordinates of the character
local coords = character . coords
Whether the character is dead or not
local isDead = character . isdead
The skin details of the character
local skin = character . skin
The component details of the character
local comps = character . comps
The component tints of the character
local compTints = character . compTints
local age = character . age
The gender of the character
local gender = character . gender
The description of the character
local charDescription = character . charDescription
The nickname of the character
local nickname = character . nickname
The inventory capacity of the character
local invCapacity = character . invCapacity
The skills of the character
local skills = character . skills
local skill = skills . Crafting
if not skill then return print ( "skill not found in core config or it doesn't exist" ) end
local skillExp = skill . Exp
local skillLevel = skill . Level
The unique identifier of the character
local identifier = character . identifier
The unique character identifier
local charIdentifier = character . charIdentifier
The group the character belongs to
local group = character . group
local job = character . job
The job grade of the character
local jobGrade = character . jobGrade
The job label of the character
local jobLabel = character . jobLabel
The amount of money the character has
local money = character . money
The amount of gold the character has
local gold = character . gold
The amount of rol the character has
local rol = character . rol
The amount of experience points the character has
The first name of the character
local firstname = character . firstname
The last name of the character
local lastname = character . lastname
The status of the character
local status = character . status
The coordinates of the character
local coords = character . coords
Whether the character is dead or not
local isDead = character . isdead
The skin details of the character
local skin = character . skin
The component details of the character
local comps = character . comps
The component tints of the character
local compTints = character . compTints
local age = character . age
The gender of the character
local gender = character . gender
The description of the character
local charDescription = character . charDescription
The nickname of the character
local nickname = character . nickname
The inventory capacity of the character
local invCapacity = character . invCapacity
The skills of the character
local skills = character . skills
local skill = skills . Crafting
if not skill then return print ( "skill not found in core config or it doesn't exist" ) end
local skillExp = skill . Exp
local skillLevel = skill . Level
If true, the job change event won’t be triggered
character . setJob ( "job" , flag )
If true, the job change event won’t be triggered
character . setJobGrade ( 1 , flag )
character . setJobLabel ( "Label" )
If true, the group change event won’t be triggered
character . setGroup ( "admin" , false )
Set the amount of Rol of the character
Set the amount of XP of the character
Set the first name of the character
character . setFirstname ( "Sadie" )
Set the last name of the character
character . setLastname ( "Adler" )
character . updateSkin ( "skin" )
The clothing components in JSON format
character . updateComps ( "comps" )
The clothing components tints in JSON format
character . updateCompTints ( "comps" )
The currency type (0 = money, 1 = gold, 2 = rol)
The amount to add to character
character . addCurrency ( 0 , 1000 )
The currency type (0 = money, 1 = gold, 2 = rol)
The amount to remove from character
character . removeCurrency ( 0 , 1000 )
The amount of XP to remove
The age to set to the character
The character description to set to the character
character . setCharDescription ( "string" )
The nickname to set to the character
character . setNickName ( "string" )
The gender to set (male or female)
character . setGender ( "string" )
The amount to change the inventory capacity by (can be positive or negative) its also incremental so 1000 will be 1000 + what you already have
character . updateInvCapacity ( 1 )
The name of the skill to set, these skillNames will be in VORP Core config skills
the Exp value to be set to the skillName you passed values are incremental so 1000 exp will be 1000 + what you already have
character . setSkills ( "skillName" , 10 ) -- skillname exp
Users
Get the user data to access getters and setters
local user = Core . getUser ( source ) --[[@as User]]
if not user then return end -- is player in session?
local user = Core . getUserByCharId ( charid ) --[[@as User]]
The user group (not character group)
local userGroup = user . getGroup
The user’s source (player ID)
local userSource = user . source
local user = Core . getUserByCharId ( charid ) --[[@as User]]
The user group (not character group)
local userGroup = user . getGroup
The user’s source (player ID)
local userSource = user . source
The group to set for the user
local steam = user . getIdentifier ()
All characters of the user
local data = user . getUserCharacters ()
The warning status of the user
local warnstatus = user . getPlayerwarnings ()
Whitelist
The identifier of the whitelist entry
local data = Core . Whitelist . getEntry ( identifier )
print ( json . encode ( data ),{ ident = true })
The identifier of the whitelist entry
local data = Core . Whitelist . getEntry ( identifier )
print ( json . encode ( data ),{ ident = true })
The identifier of the whitelist entry
Core . Whitelist . whitelistUser ( identifier )
The identifier of the whitelist entry
Core . Whitelist . unWhitelistUser ( identifier )
Webhooks
The description of the webhook
The footerlogo of the webhook
The avatar of the webhook
Core . AddWebhook ( "title" , "webhook" , "description" , 12345678 , "name" , "logo" , "footerlogo" , "avatar" )
Instancing
to add a players to different instances use his server id + instance number
to add players to same instance use only the instanceNumber
local instanceNumber = 54123 -- any number
VORPcore . instancePlayers ( GetPlayerServerId ( PlayerId ()) + instanceNumber )
remove players from instance
VORPcore . instancePlayers ( 0 )
Player
Available through core export
Server Side
when using these functions you will benefit of the event listeners OnPlayerDeath
OnPlayerRevive
OnPlayerRespawn
Core . Player . Revive ( source )
Core . Player . Respawn ( source )
Callbacks
Callbacks are available through core export or single exports
if you need only the call back system
local ServerRPC = exports . vorp_core : ServerRpcCall () --[[@as ServerRPC]] -- for intellisense
trigger a synchronous callback from client to server
The parameters to pass to the callback
The result of the callback
local result = Core . Callback . TriggerAwait ( name , ... )
print ( result )
trigger an asynchronous callback from client to server
The parameters to pass to the callback
The result of the callback
Core . Callback . TriggerAsync ( name , function ( result )
print ( result )
end , ... )
register a callback on the server to receive a client callback
The source of the callback
The parameters to pass to the callback
The result of the callback
Core . Callback . Register ( name , function ( source , callback ,...)
callback ( ... )
end )
if you need only the call back system
local ServerRPC = exports . vorp_core : ServerRpcCall () --[[@as ServerRPC]] -- for intellisense
trigger a synchronous callback from client to server
The parameters to pass to the callback
The result of the callback
local result = Core . Callback . TriggerAwait ( name , ... )
print ( result )
trigger an asynchronous callback from client to server
The parameters to pass to the callback
The result of the callback
Core . Callback . TriggerAsync ( name , function ( result )
print ( result )
end , ... )
register a callback on the server to receive a client callback
The source of the callback
The parameters to pass to the callback
The result of the callback
Core . Callback . Register ( name , function ( source , callback ,...)
callback ( ... )
end )
if you need only the call back system
local ClientRPC = exports . vorp_core : ClientRpcCall () --[[@as ClientRPC]] -- for intellisense
trigger a server to client callback synchronously
The source of the callback
The parameters to pass to the callback
The result of the callback
local result = Core . Callback . TriggerAwait ( name , source , ... )
print ( result )
trigger an asynchronous callback from client to server
The source of the callback
The parameters to pass to the callback
The result of the callback
Core . Callback . TriggerAsync ( name , source , function ( result )
print ( result )
end , ... )
register a callback on the client to receive a server callback
The parameters to pass to the callback
The result of the callback
Core . Callback . Register ( name , function ( callback ,...)
callback ( ... )
end )
Events
Event Listeners to detect changes in the player state
when player job and group changes these events are triggered
onGroupChange
AddEventHandler ( "vorp:playerGroupChange" , function ( source , newgroup , oldgroup ) end )
onJobChange
AddEventHandler ( "vorp:playerJobChange" , function ( source , newjob , oldjob ) end )
onJobGradeChange
AddEventHandler ( "vorp:playerJobGradeChange" , function ( source , newjobgrade , oldjobgrade ) end )
onPlayerDeath
when player dies this event is triggered
--CLIENT
AddEventHandler ( "vorp_core:Client:OnPlayerDeath" , function ( killerserverid , causeofdeath ) end )
--SERVER
RegisterNetEvent ( "vorp_core:Server:OnPlayerDeath" , function ( killerserverid , causeofdeath ) end )
onPlayerRevive
when player is revived through VORP Core export this event will trigger
--SERVER
AddEventHandler ( "vorp_core:Server:OnPlayerRevive" , function ( source ) end )
--CLIENT
RegisterNetEvent ( "vorp_core:Client:OnPlayerRevive" )
onPlayerRespawn
when player respawns through VORP Core export this event will trigger
--SERVER
AddEventHandler ( "vorp_core:Server:OnPlayerRespawn" function ( source ) end )
--CLIENT
RegisterNetEvent ( "vorp_core:Client:OnPlayerRespawn" )
onPlayerHeal
when player is healed through VORP Core export this event will trigger
--SERVER
AddEventHandler ( "vorp_core:Server:OnPlayerHeal" , function ( source ) end )
--CLIENT
RegisterNetEvent ( "vorp_core:Client:OnPlayerHeal" )
onPlayerLevelUp
triggered when a player has leveled up or down
--SERVER
AddEventHandler ( "vorp_core:Server:OnPlayerLevelUp" , function ( source , skillName , newLevel , oldLevel ) end )
--CLIENT
RegisterNetEvent ( "vorp_core:Client:OnPlayerLevelUp" , function ( skillName , newLevel , oldLevel ) end )
onPlayerSpawned
triggered when a player has fully spawned after teleportation and loading screens
--CLIENT
AddEventHandler ( "vorp_core:Client:OnPlayerSpawned" , function () end )
Dataview
call dataview in your script fxmanifest
client_scripts {
'@vorp_core/client/dataview.lua'
}
GlobalStates
easily get players count from client or server
GlobalState . PlayersInSession
Statebags
statebag getters that allow you to get the character data
is player in session? this will return true when player choose his character
The IsInSession of the character
LocalPlayer . state . IsInSession
get the first name of the character
The first name of the character
LocalPlayer . state . Character . FirstName
get the last name of the character
The last name of the character
LocalPlayer . state . Character . LastName
get the job of the character
LocalPlayer . state . Character . Job
get the job label of the character
The job label of the character
LocalPlayer . state . Character . JobLabel
get the grade of the character
The grade of the character
LocalPlayer . state . Character . Grade
get the group of the character
The group of the character
LocalPlayer . state . Character . Group
get the age of the character
LocalPlayer . state . Character . Age
get the gender of the character
The gender of the character
LocalPlayer . state . Character . Gender
get the nickname of the character
The nickname of the character
LocalPlayer . state . Character . NickName
get the character description of the character
The character description of the character
LocalPlayer . state . Character . CharDescription
get the money of the character
The money of the character
LocalPlayer . state . Character . Money
get the gold of the character
The gold of the character
LocalPlayer . state . Character . Gold
get the rol of the character
LocalPlayer . state . Character . Rol
get the charid of the character
The charid of the character
LocalPlayer . state . Character . CharId
is player in session? this will return true when player choose his character
The IsInSession of the character
LocalPlayer . state . IsInSession
get the first name of the character
The first name of the character
LocalPlayer . state . Character . FirstName
get the last name of the character
The last name of the character
LocalPlayer . state . Character . LastName
get the job of the character
LocalPlayer . state . Character . Job
get the job label of the character
The job label of the character
LocalPlayer . state . Character . JobLabel
get the grade of the character
The grade of the character
LocalPlayer . state . Character . Grade
get the group of the character
The group of the character
LocalPlayer . state . Character . Group
get the age of the character
LocalPlayer . state . Character . Age
get the gender of the character
The gender of the character
LocalPlayer . state . Character . Gender
get the nickname of the character
The nickname of the character
LocalPlayer . state . Character . NickName
get the character description of the character
The character description of the character
LocalPlayer . state . Character . CharDescription
get the money of the character
The money of the character
LocalPlayer . state . Character . Money
get the gold of the character
The gold of the character
LocalPlayer . state . Character . Gold
get the rol of the character
LocalPlayer . state . Character . Rol
get the charid of the character
The charid of the character
LocalPlayer . state . Character . CharId
is player in session? this will return true when player choose his character
The IsInSession of the character
Player ( source ). state . IsInSession
get the first name of the character
The first name of the character
Player ( source ). state . Character . FirstName
get the last name of the character
The last name of the character
Player ( source ). state . Character . LastName
get the job of the character
Player ( source ). state . Character . Job
get the job label of the character
The job label of the character
Player ( source ). state . Character . JobLabel
get the grade of the character
The grade of the character
Player ( source ). state . Character . Grade
get the group of the character
The group of the character
Player ( source ). state . Character . Group
get the age of the character
Player ( source ). state . Character . Age
get the gender of the character
The gender of the character
Player ( source ). state . Character . Gender
get the nickname of the character
The nickname of the character
Player ( source ). state . Character . NickName
get the character description of the character
The character description of the character
Player ( source ). state . Character . CharDescription
get the money of the character
The money of the character
Player ( source ). state . Character . Money
get the gold of the character
The gold of the character
Player ( source ). state . Character . Gold
get the rol of the character
Player ( source ). state . Character . Rol
get the charid of the character
The charid of the character
Player ( source ). state . Character . CharId
Version
Use vorp version check with change logs feature in your scripts
add this in your fxmanifest
-- version must match version.file
version '0.0.1'
vorp_checker 'yes'
-- can use color codes ^1
vorp_name '^5your resource name ^4version Check^3'
-- path to the github repository, in here it must have a version.file file type where your change logs will be, also must be public repository
vorp_github 'https://github.com/repository/resource_name'
example of a version.file
< 0.0 .1 > -- version must be the same in fxmanifest
- new version
- added feature
- removed feature
- fixed something