VORP Core Framework API Documentation
This documentation covers the complete VORP Core Framework API for developers creating scripts and integrations.
Table of Contents
- Core Export
- Notifications
- Character Management
- User Management
- Whitelist
- Webhooks
- Instancing
- Player Functions
- Callbacks/RPC System
- Events
- Dataview
- Global States
- Statebags
- Version Checking
Core Export
The core export provides access to all VORP Core functionality. Some getters and setters are client-side only, while others are server-side only.
local Core = exports.vorp_core:GetCore()
Returns: The core table containing all the getters and setters for VORP Core.
Notifications
VORP Core provides various notification types for user interface feedback. Notifications can accept -1 as duration to always stay on screen. To clear persistent notifications, use UiFeedClearChannel.
Notifications > Client-Side Notifications > Left Notification
Core.NotifyLeft("title", "subtitle", "dict", "icon", 4000, "color")
Parameters:
title- Notification titlesubtitle- Notification subtitledict- Icon dictionaryicon- Icon name4000- Duration in millisecondscolor- Notification color
Notifications > Client-Side Notifications > Warning Notification
Core.NotifyWarning("title", "subtitle", "audioref", "audioname", 4000)
Parameters:
title- Notification titlesubtitle- Notification subtitleaudioref- Audio referenceaudioname- Audio name4000- Duration in milliseconds
Notifications > Client-Side Notifications > Left Rank Notification
Core.NotifyLeftRank("title", "subtitle", "dict", "icon", 4000, "color")
Parameters:
title- Notification titlesubtitle- Notification subtitledict- Icon dictionaryicon- Icon name4000- Duration in millisecondscolor- Notification color
Notifications > Server-Side Notifications > Left Notification (Server)
Core.NotifyLeft(source, "title", "subtitle", "dict", "icon", 4000, "color")
Parameters:
source- Player source IDtitle- Notification titlesubtitle- Notification subtitledict- Icon dictionaryicon- Icon name4000- Duration in millisecondscolor- Notification color
Notifications > Server-Side Notifications > Advanced Notification
Core.NotifyAvanced(source, "title", "dict", "icon", "color", 4000)
Parameters:
source- Player source IDtitle- Notification titledict- Icon dictionaryicon- Icon namecolor- Notification color4000- Duration in milliseconds
Notifications > Server-Side Notifications > Warning Notification (Server)
Core.NotifyWarning(source, "title", "subtitle", "audioref", "audioname", 4000)
Parameters:
source- Player source IDtitle- Notification titlesubtitle- Notification subtitleaudioref- Audio referenceaudioname- Audio name4000- Duration in milliseconds
Notifications > Server-Side Notifications > Left Rank Notification (Server)
Core.NotifyLeftRank(source, "title", "subtitle", "dict", "icon", 4000, "color")
Parameters:
source- Player source IDtitle- Notification titlesubtitle- Notification subtitledict- Icon dictionaryicon- Icon name4000- Duration in millisecondscolor- Notification color
Character Management
Character data provides access to all character-related information and modification functions.
Character Management > Getting Character Data
local user = Core.getUser(source) --[[@as User]]
if not user then return end -- is player in session?
local character = user.getUsedCharacter --[[@as Character]]
Character Management > Character Skills > Getting Skills
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
Character Management > Character Skills > Setting Skills
character.setSkills("skillName", 10) -- skillname exp
Parameters:
skillName- The name of the skill to set (must exist in VORP Core config skills)exp- The experience value to be set (values are incremental, so 1000 exp will be 1000 + current exp)
Character Management > Character Properties > Job Management
character.setJobLabel("Label")
Parameters:
Label- The job label to set
Character Management > Character Properties > Currency Management
character.setRol(1000) -- Set Rol amount
Parameters:
1000- Amount of Rol to set
Character Management > Character Properties > Experience Management
character.setXp(5000) -- Set XP amount
character.addXp(100) -- Add XP
character.removeXp(100) -- Remove XP
Parameters:
5000- Amount of XP to set100- Amount of XP to add/remove
Character Management > Character Properties > Personal Information
character.setFirstname("Sadie") -- Set first name
character.setLastname("Adler") -- Set last name
character.setAge(45) -- Set age
character.setCharDescription("string") -- Set character description
character.setNickName("string") -- Set nickname
character.setGender("string") -- Set gender (male or female)
Parameters:
"Sadie"- First name to set"Adler"- Last name to set45- Age to set"string"- Description/nickname/gender to set
Character Management > Character Properties > Appearance Management
character.updateSkin("skin") -- Update skin
character.updateComps("comps") -- Update clothing components
character.updateCompTints("comps") -- Update clothing component tints
Parameters:
"skin"- The skin data in JSON format"comps"- The clothing components in JSON format
Character Management > Character Properties > Inventory Management
character.updateInvCapacity(1)
Parameters:
1- Amount to change inventory capacity by (can be positive or negative, incremental)
User Management
User data provides access to user-level information and functions.
User Management > Getting User Data
local user = Core.getUser(source) --[[@as User]]
if not user then return end -- is player in session?
User Management > User Functions > Group Management
user.SetGroup(group)
Parameters:
group- The group to set for the user
User Management > User Functions > User Information
local steam = user.getIdentifier() -- Get Steam ID
local data = user.getUserCharacters() -- Get all characters
local warnstatus = user.getPlayerwarnings() -- Get warning status
Returns:
steam- The Steam ID of the userdata- All characters of the userwarnstatus- The warning status of the user
Whitelist
Whitelist management functions for controlling server access.
Whitelist > Get Whitelist Entry
local data = Core.Whitelist.getEntry(identifier)
print(json.encode(data), {ident = true})
Parameters:
identifier- Player identifier to check
Returns: Whitelist entry data
Webhooks
Send webhook notifications to Discord or other services.
Webhooks > Add Webhook
Core.AddWebhook("title", "webhook", "description", 12345678, "name", "logo", "footerlogo", "avatar")
Parameters:
"title"- The title of the webhook"webhook"- The webhook link"description"- The description of the webhook12345678- The color of the webhook"name"- The name of the webhook"logo"- The logo of the webhook"footerlogo"- The footer logo of the webhook"avatar"- The avatar of the webhook
Instancing
Player instancing system for separating players into different game instances.
Instancing > Add Players to Instance
To add players to different instances, use their server ID + instance number. To add players to the same instance, use only the instance number.
local instanceNumber = 54123 -- any number
VORPcore.instancePlayers(GetPlayerServerId(PlayerId()) + instanceNumber)
Instancing > Remove Players from Instance
VORPcore.instancePlayers(0)
Player Functions
Player health and revival system functions. These functions benefit from event listeners and trigger corresponding events.
Player Functions > Health Management
Core.Player.Heal(source) -- Heal player
Core.Player.Revive(source) -- Revive player
Core.Player.Respawn(source) -- Respawn player
Parameters:
source- Player source ID
Callbacks/RPC System
Remote procedure call system for client-server communication.
Callbacks/RPC System > Server-Side Callbacks > Using Core Export
Core.Callback.Register(name, function(source, callback, ...)
callback(...)
end)
Callbacks/RPC System > Server-Side Callbacks > Using Single Export
local ServerRPC = exports.vorp_core:ServerRpcCall() --[[@as ServerRPC]] -- for intellisense
-- Register a callback on the server to receive a client callback
ServerRPC.Register(name, function(source, callback, ...)
callback(...)
end)
Callbacks/RPC System > Client-Side Callbacks > Using Core Export
Core.Callback.Register(name, function(callback, ...)
callback(...)
end)
Callbacks/RPC System > Client-Side Callbacks > Using Single Export
local ClientRPC = exports.vorp_core:ClientRpcCall() --[[@as ClientRPC]] -- for intellisense
-- Register a callback on the client to receive a server callback
ClientRPC.Register(name, function(callback, ...)
callback(...)
end)
Parameters:
name- Callback name/identifiercallback- The callback function to execute
Events
Event listeners for detecting changes in player state and game events.
Events > Job and Group Events > Group Change Event
AddEventHandler("vorp:playerGroupChange", function(source, newgroup, oldgroup) end)
Events > Job and Group Events > Job Change Event
AddEventHandler("vorp:playerJobChange", function(source, newjob, oldjob) end)
Events > Job and Group Events > Job Grade Change Event
AddEventHandler("vorp:playerJobGradeChange", function(source, newjobgrade, oldjobgrade) end)
Events > Player State Events > Player Death Event
-- CLIENT
AddEventHandler("vorp_core:Client:OnPlayerDeath", function(killerserverid, causeofdeath) end)
-- SERVER
RegisterNetEvent("vorp_core:Server:OnPlayerDeath", function(killerserverid, causeofdeath) end)
Events > Player State Events > Player Revive Event
-- SERVER
AddEventHandler("vorp_core:Server:OnPlayerRevive", function(source) end)
-- CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerRevive")
Events > Player State Events > Player Respawn Event
-- SERVER
AddEventHandler("vorp_core:Server:OnPlayerRespawn", function(source) end)
-- CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerRespawn")
Events > Player State Events > Player Heal Event
-- SERVER
AddEventHandler("vorp_core:Server:OnPlayerHeal", function(source) end)
-- CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerHeal")
Events > Player State Events > Player Level Up Event
-- SERVER
AddEventHandler("vorp_core:Server:OnPlayerLevelUp", function(source, skillName, newLevel, oldLevel) end)
-- CLIENT
RegisterNetEvent("vorp_core:Client:OnPlayerLevelUp", function(skillName, newLevel, oldLevel) end)
Events > Player State Events > Player Spawned Event
-- CLIENT
AddEventHandler("vorp_core:Client:OnPlayerSpawned", function() end)
Event Parameters:
source- Player source IDkillerserverid- ID of the killer (if applicable)causeofdeath- Cause of deathskillName- Name of the skill that leveled upnewLevel- New skill leveloldLevel- Previous skill levelnewgroup/oldgroup- New and old group valuesnewjob/oldjob- New and old job valuesnewjobgrade/oldjobgrade- New and old job grade values
Dataview
To use dataview functionality in your script, add the following to your fxmanifest.lua:
client_scripts {
'@vorp_core/client/dataview.lua'
}
Global States
Global state variables accessible from both client and server.
Global States > Players Count
GlobalState.PlayersInSession
Returns: Current number of players in session
Statebags
Statebag getters for accessing character data efficiently.
Statebags > Client-Side Statebags > Session Status
LocalPlayer.state.IsInSession -- Returns true when player chooses character
Statebags > Client-Side Statebags > Character Information
LocalPlayer.state.Character.FirstName -- First name
LocalPlayer.state.Character.LastName -- Last name
LocalPlayer.state.Character.JobLabel -- Job label
LocalPlayer.state.Character.Grade -- Grade
LocalPlayer.state.Character.Group -- Group
LocalPlayer.state.Character.Gender -- Gender
LocalPlayer.state.Character.NickName -- Nickname
LocalPlayer.state.Character.CharDescription -- Character description
LocalPlayer.state.Character.Money -- Money amount
LocalPlayer.state.Character.Gold -- Gold amount
LocalPlayer.state.Character.CharId -- Character ID
Statebags > Server-Side Statebags > Session Status
Player(source).state.IsInSession -- Returns true when player chooses character
Statebags > Server-Side Statebags > Character Information
Player(source).state.Character.FirstName -- First name
Player(source).state.Character.LastName -- Last name
Player(source).state.Character.Job -- Job
Player(source).state.Character.JobLabel -- Job label
Player(source).state.Character.Grade -- Grade
Player(source).state.Character.Group -- Group
Player(source).state.Character.Age -- Age
Player(source).state.Character.Gender -- Gender
Player(source).state.Character.NickName -- Nickname
Player(source).state.Character.CharDescription -- Character description
Player(source).state.Character.Money -- Money amount
Player(source).state.Character.Gold -- Gold amount
Player(source).state.Character.Rol -- Rol amount
Player(source).state.Character.CharId -- Character ID
Version Checking
VORP Core includes a version checking system with changelog features.
Version Checking > Setup in fxmanifest.lua
-- 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
-- Must have a version.file containing changelogs
-- Repository must be public
vorp_github 'https://github.com/repository/resource_name'
Version Checking > version.file Format
Create a version.file in your GitHub repository root:
<0.0.1>
- new version
- added feature
- removed feature
- fixed something
Requirements:
- Version in
<>brackets must match the version infxmanifest.lua - Repository must be public
version.filemust be in the repository root- Each changelog entry should be on a new line with
-prefix
Notes
- This documentation is for developers creating scripts for the VORP Core Framework
- Some functions are client-side only, others are server-side only
- Notifications support persistent display with
-1duration - Statebags provide efficient access to frequently-used character data
- Events are triggered automatically when using Core player functions
- The callback/RPC system supports both synchronous and asynchronous operations
- Version checking helps maintain compatibility across script updates