Skip to content

Roleplay Redux ​

This library will not function if your server doesn't have Roleplay Redux installed:

Roll function ​

Syntax:

lua
int RPR.Roll( Character player, string skill [, int modifier = 0, bool show = false, string comment = "" ] )

GetSkill function ​

Syntax:

lua
int, int RPR.GetSkill( Character player, string skill )

GetStat function ​

Syntax:

lua
int, int RPR.GetStat( Character player, string stat )

HasPerk function ​

Syntax:

lua
bool RPR.HasPerk( Character player, string perk )

AddPerk function ​

Syntax:

lua
bool RPR.AddPerk( Character player, string perk )

RemovePerk function ​

Syntax:

lua
bool RPR.RemovePerk( Character player, string perk )

ModifySkill function ​

Syntax:

lua
bool RPR.ModifySkill( Character player, string skill, int modifier )

ModifyStat function ​

Syntax:

lua
bool RPR.ModifyStat( Character player, string stat, int modifier )

SetStat function ​

Syntax:

lua
bool RPR.SetStat( Character player, string stat, int value )

SetStatMax function ​

Syntax:

lua
bool RPR.SetStatMax( Character player, string stat, int value )

HasRune function ​

Syntax:

lua
bool RPR.HasRune( Character player, int itemId )

HasBuff function ​

Syntax:

lua
bool RPR.HasBuff( Character player, string category )

RemoveBuff function ​

Syntax:

lua
bool RPR.RemoveBuff( Character player, string category )

GiveBuff function ​

To understand buff types and other arguments, please refer to Tot API docs.

Alternatively you can use BuffSkill, BuffStat, BuffPerk, BuffAbility, BuffStatus.

All of those are aliases for this function.

Syntax:

lua
bool RPR.GiveBuff( Character player, string category, int buffType [, string target = category, int modifier = 0, int duration = -1, int delay = 0 ] )

BuffSkill function ​

Syntax:

lua
bool RPR.BuffSkill( Character player, string category, string skill, int modifier [, int duration = -1 ] )

BuffStat function ​

Syntax:

lua
bool RPR.BuffStat( Character player, string category, string stat, int modifier [, int duration = -1 ] )

BuffPerk function ​

Syntax:

lua
bool RPR.BuffPerk( Character player, string category, string perk [, int duration = -1 ] )

BuffAbility function ​

Syntax:

lua
bool RPR.BuffAbility( Character player, string category, string ability [, int duration = -1 ] )

BuffStatus function ​

Syntax:

lua
bool RPR.BuffStatus( Character player, string category, string status [, int duration = -1 ] )

HasItem function ​

Syntax:

lua
bool RPR.HasItem( Character player, int itemId [, int quantity = 1 ] )

TakeItem function ​

Syntax:

lua
void RPR.TakeItem( Character player, int itemId [, int quantity = 1 ] )

GiveItem function ​

Syntax:

lua
void RPR.GiveItem( Character player, int itemId [, int quantity = 1 ] )

GetBuffs function ​

Syntax:

lua
table<string> RPR.GetBuffs( Character player )

GetSheet function ​

Returns a CharacterSheet object.

Syntax:

lua
CharacterSheet RPR.GetSheet( Character player )

ResetSheet function ​

Syntax:

lua
bool RPR.ResetSheet( Character player )

ExportSheet function ​

Syntax:

lua
string RPR.ExportSheet( Character player )

ImportSheet function ​

Syntax:

lua
bool RPR.ImportSheet( Character player, string data )

HasSpell function ​

Syntax:

lua
bool RPR.HasSpell( Character player, string spell )

LearnSpell function ​

Syntax:

lua
bool RPR.LearnSpell( Character player, string spell )

ForgetSpell function ​

Syntax:

lua
bool RPR.ForgetSpell( Character player, string spell )

Refresh function ​

Force RPR side panel to refresh for specific player.

Syntax:

lua
void RPR.Refresh( Character player )

GetAbilities function ​

Retrieves a list of all abilities in the RPR system.

A table is returned, containing ReduxAbility objects. If the keyed argument is set to true, then ability IDs will be used as table keys, otherwise the table is sequential by default.

Syntax:

lua
table<ReduxAbility> RPR.GetAbilities( [ bool keyed = false ] )

GetEquippedRunes function ​

Returns two tables. First one corresponds to item template IDs of the equipped runes while the other one corresponds to RPR rune IDs. Both tables are sequential and their indexes should correspond to each other, however this is not guaranteed.

Syntax:

lua
table<int>, table<int> RPR.GetEquippedRunes( Character player )

SetEquippedRunes function ​

Forces a list of rune IDs to be equipped, replacing currently equipped runes.

Syntax:

lua
void RPR.SetEquippedRunes( Character player, table<int> runes )

WARNING

Be super careful with this function when using it inside RPR_updateRunes event, as that could easily lead into infinite loop and slow down or even crash the server.

GetUserStatus function ​

Retrieves the custom status set by a user in RPR's Bio tab.

Syntax:

lua
string, Color RPR.GetUserStatus( Character player )

SetUserStatus function ​

Replaces the custom status in RPR's Bio tab and on nameplate.

Syntax:

lua
void RPR.SetUserStatus( Character player, string name, Color color )

GetBio function ​

Syntax:

lua
table RPR.GetBio( Character player )
FieldType
shortDescstring
longDescstring
renownstring
portraitstring

GetConsents function ​

Syntax:

lua
table RPR.GetConsents( Character player )
FieldType
answerstable<string>
choicestable<table<int>>

Both fields are tables indexed by IDs, they might not be sequential.

ClearPerks function ​

Remove all assigned perks from a character.

Syntax:

lua
bool RPR.ClearPerks( Character player )

ClearSpells function ​

Remove all learned spells from a character.

Syntax:

lua
bool RPR.ClearSpells( Character player )

ClearBuffs function ​

Remove all active buffs from a character.

Syntax:

lua
bool RPR.ClearBuffs( Character player )

GetAssignedPerks function ​

Returns a list of IDs of assigned perks. To retrieve perk names, use GetSheet instead.

Syntax:

lua
table RPR.GetAssignedPerks( Character player )

GetLearnedSpells function ​

Returns a list of IDs of learned spells.

Syntax:

lua
table RPR.GetLearnedSpells( Character player )

GetActiveBuffs function ​

Syntax:

lua
table RPR.GetActiveBuffs( Character player )
FieldType
categorystring
typenumber
targetnumber
modifiernumber
fromstring
untilstring
permanentboolean

GetLFRP function ​

Retrieve the LFRP information of a player.

Syntax:

lua
table RPR.GetLFRP( Character player )
FieldType
enabledboolean
showNameboolean
showMarkerboolean
namestring
self1string
self2string
looking1string
looking2string

SetLFRP function ​

Set the LFRP information, uses the same options fields as GetLFRP.

Syntax:

lua
void RPR.SetLFRP( Character player, table options )

GetWaypoints function ​

Syntax:

lua
table RPR.GetWaypoints()
FieldType
idnumber Legacy / GUID Enhanced
enabledboolean
hiddenboolean
showMarkerboolean
namestring
categorystring
colorColor
locationVector
rotationRotator

WARNING

Waypoint IDs changed from plain numbers to GUID with Enhanced.

TeleportToWaypoint function ​

Syntax:

lua
bool RPR.TeleportToWaypoint( Character player, GUID waypointId )
lua
bool RPR.TeleportToWaypoint( Character player, int waypointId )

Locks ​

BuildingPiece objects also expose RPR's lock system directly:

  • :IsRPLocked
  • :SetRPLocked
  • :GetRPKey
  • :SetRPKey