Skip to main content

Events

This event is triggered when a player has successfully selected a character and joined the server. It provides an opportunity to execute custom logic or initialize player-specific data based on the chosen character. The event is fired on both the client and server side
Client Side
SelectedCharacter
RegisterNetEvent("vorp:SelectedCharacter", function(charid)
   print(charid)
end)
Server Side
SelectedCharacter
AddEventHandler("vorp:SelectedCharacter",function(source,character)
    print(character)
end)
This event is triggered when a player has created a new character for the server. Example Usage Case: Someone might use this to create/select a first spawn location for a character.
Client Side
initNewCharacter
AddEventHandler("vorp:initNewCharacter", function()
    print("New Character Created")
end)
Ability to wait for the first character scene to start in case you need to show a loading screen or something else before the scene starts
Client Side
stopLoadingScene
-- this is just optional
-- you can use it to tell character to not start the scene yet like  imagine if you have a loading screen with a button to join, this event will make it to wait
-- set to true to wait, set to false to continue the scene
TriggerEvent("vorpcharacter:stopLoadingScene", boolean)

Exports

Exports to be used in your scripts
Client Side
This export retrieves all components in the player’s cache, useful for updating or modifying the player’s appearance based on the components stored in the cache
return
table
The components in the player’s cache.
local result = exports.vorp_character:GetAllPlayerComponents()
Client Side
This export retrieves a specific component
category
string
required
The category of the component to retrieve.
return
string
The components in the player’s cache.
local component = exports.vorp_character:GetPlayerComponent(category)
Server Side
This export opens the outfits menu for the player
source
int
required
The source of the player.
return
boolean
True if the menu can be opened false otherwise.
local result = exports.vorp_character:OpenOutfitsMenu(source)

StateBags

Bandana state you can use this in ohter script to check if player is wearing a bandana on his face using characters bandana commands
LocalPlayer.state.IsBandanaOn
check if player is in character shops
LocalPlayer.state.PlayerIsInCharacterShops