Skip to main content
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.
Shared
return
table
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
Shared
  • Client
  • Server
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
dict
string
required
The dictionary for the icon
icon
string
required
The icon name
duration
number
required
Duration in milliseconds
color
string
required
Color of the notification
Core.NotifyLeft("title", "subtitle", "dict", "icon", 4000, "color")
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyTip("title", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
dict
string
required
The dictionary for the icon
icon
string
required
The icon name
duration
number
required
Duration in milliseconds
color
string
required
Color of the notification
Core.NotifyLeft("title", "subtitle", "dict", "icon", 4000, "color")
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyRightTip("title", 4000)
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyObjective("title", 4000)
title
string
required
The title of the notification
location
string
required
The location to display
duration
number
required
Duration in milliseconds
Core.NotifyTop("title", "location", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
duration
number
required
Duration in milliseconds
Core.NotifySimpleTop("title", "subtitle", 4000)
title
string
required
The title of the notification
dict
string
required
The dictionary for the icon
icon
string
required
The icon name
color
string
required
Color of the notification
duration
number
required
Duration in milliseconds
Core.NotifyAvanced("title", "dict", "icon", "color", 4000)
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyCenter("title", 4000)
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyBottomRight("title", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
duration
number
required
Duration in milliseconds
Core.NotifyFail("title", "subtitle", 4000)
title
string
required
The title of the notification
audioref
string
required
The audio reference
audioname
string
required
The audio name
duration
number
required
Duration in milliseconds
Core.NotifyDead("title", "audioref", "audioname", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
duration
number
required
Duration in milliseconds
Core.NotifyUpdate("title", "subtitle", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
audioref
string
required
The audio reference
audioname
string
required
The audio name
duration
number
required
Duration in milliseconds
Core.NotifyWarning("title", "subtitle", "audioref", "audioname", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
dict
string
required
The dictionary for the icon
icon
string
required
The icon name
duration
number
required
Duration in milliseconds
color
string
required
Color of the notification
Core.NotifyLeftRank("title", "subtitle", "dict", "icon", 4000, "color")
title
string
required
The title of the notification
duration
number
required
Duration in milliseconds
Core.NotifyOneSimpleTop("title", 4000)
title
string
required
The title of the notification
description
string
required
The description of the notification
second_description
string
required
The second description of the notification
duration
number
required
Duration in milliseconds
Core.NotifyThreeSimpleTop("title","description","second_description", 4000)
title
string
required
The title of the notification
subtitle
string
required
The subtitle of the notification
dict
string
required
The dictionary for the icon
icon
string
required
The icon name
duration
number
required
Duration in milliseconds or -1 for infinite
color
string
required
Color of the notification
Core.NotifyLeftInteractive("title", "subtitle", "dict", "icon", 4000, "color")

Characters

Get the character data to access getters and setters
Server
source
integer
required
The player ID
    local user = Core.getUser(source) --[[@as User]]  
    if not user then return end -- is player in session?
    local character = user.getUsedCharacter --[[@as Character]]
  • getters
  • setters
return
string
The unique identifier of the character
local identifier = character.identifier
return
string
The unique character identifier
local charIdentifier = character.charIdentifier
return
string
The group the character belongs to
local group = character.group
return
string
The job of the character
local job = character.job
return
integer
The job grade of the character
local jobGrade = character.jobGrade
return
string
The job label of the character
local jobLabel = character.jobLabel
return
number
The amount of money the character has
local money = character.money
return
number
The amount of gold the character has
local gold = character.gold
return
number
The amount of rol the character has
local rol = character.rol
return
number
The amount of experience points the character has
local xp = character.xp
return
string
The first name of the character
local firstname = character.firstname
return
string
The last name of the character
local lastname = character.lastname
return
table
The status of the character
local status = character.status
return
table
The coordinates of the character
local coords = character.coords
return
boolean
Whether the character is dead or not
local isDead = character.isdead
return
table
The skin details of the character
local skin = character.skin
return
table
The component details of the character
local comps = character.comps
return
table
The component tints of the character
local compTints = character.compTints
return
number
The age of the character
local age = character.age
return
string
The gender of the character
local gender = character.gender
return
string
The description of the character
local charDescription = character.charDescription
return
string
The nickname of the character
local nickname = character.nickname
return
number
The inventory capacity of the character
local invCapacity = character.invCapacity
return
table
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

Users

Get the user data to access getters and setters
source
number
required
The player ID
local user = Core.getUser(source) --[[@as User]]  
if not user then return end -- is player in session?
  • getters
  • setters
charid
number
required
The character ID
local user = Core.getUserByCharId(charid) --[[@as User]]
return
string
The user group (not character group)
local userGroup = user.getGroup
return
integer
The user’s source (player ID)
local userSource = user.source

Whitelist

Server
  • getters
  • setters
identifier
string
required
The identifier of the whitelist entry
local data = Core.Whitelist.getEntry(identifier)
print(json.encode(data),{ident = true})

Webhooks

Shared
title
string
required
The title of the webhook
webhook
string
required
The webhook link
description
string
required
The description of the webhook
color
number
required
The color of the webhook
name
string
required
The name of the webhook
The logo of the webhook
The footerlogo of the webhook
avatar
string
The avatar of the webhook
Core.AddWebhook("title", "webhook", "description", 12345678, "name", "logo", "footerlogo", "avatar")

Instancing

Client
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
source
integer
required
The player ID
Core.Player.Heal(source)
source
integer
required
The player ID
Core.Player.Revive(source)
source
integer
required
The player ID
Core.Player.Respawn(source)

Callbacks

Callbacks are available through core export or single exports
  • Server
  • Client
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
name
string
required
The name of the callback
...
any
The parameters to pass to the callback
return
any
The result of the callback
local result =  Core.Callback.TriggerAwait(name,...)
print(result)
trigger an asynchronous callback from client to server
name
string
required
The name of the callback
...
any
The parameters to pass to the callback
return
any
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
name
string
required
The name of the callback
callback
function
required
The callback function
source
integer
The source of the callback
callback
function
The callback function
...
any
The parameters to pass to the callback
return
any
The result of the callback
Core.Callback.Register(name, function(source,callback,...)
   callback(...)
 end)

Events

Event Listeners to detect changes in the player state when player job and group changes these events are triggered
Server Side

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
Shared
  • client
  • server
is player in session? this will return true when player choose his character
return
boolean
The IsInSession of the character
LocalPlayer.state.IsInSession
get the first name of the character
return
string
The first name of the character
LocalPlayer.state.Character.FirstName
get the last name of the character
return
string
The last name of the character
LocalPlayer.state.Character.LastName
get the job of the character
return
string
The job of the character
LocalPlayer.state.Character.Job
get the job label of the character
return
string
The job label of the character
LocalPlayer.state.Character.JobLabel
get the grade of the character
return
integer
The grade of the character
LocalPlayer.state.Character.Grade
get the group of the character
return
string
The group of the character
LocalPlayer.state.Character.Group
get the age of the character
return
integer
The age of the character
LocalPlayer.state.Character.Age
get the gender of the character
return
string
The gender of the character
LocalPlayer.state.Character.Gender
get the nickname of the character
return
string
The nickname of the character
LocalPlayer.state.Character.NickName
get the character description of the character
return
string
The character description of the character
LocalPlayer.state.Character.CharDescription
get the money of the character
return
integer
The money of the character
LocalPlayer.state.Character.Money
get the gold of the character
return
integer
The gold of the character
LocalPlayer.state.Character.Gold
get the rol of the character
return
integer
The rol of the character
LocalPlayer.state.Character.Rol
get the charid of the character
return
integer
The charid of the character
LocalPlayer.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
I