Skip to main content
Version: 5.9.0

SysResetExperiencePointsAndLevel

System call (cloud code only if from client) to reset the experience points for the session user to a given value. The user's experienceLevel will remain unchanged unless recalculateXPLevel is true, in which case the user's experienceLevel will also be reset to the applicable level (to be used with caution). If the XP points value to be reset is HIGHER than the user's current experiencePoints, an error is returned unless skipResetIfUserXPPointsAlreadyLower is true.

ServiceOperation
playerStatisticsSYS_RESET_EXPERIENCE_POINTS_AND_LEVEL

Method Parameters

ParameterDescription
xp_pointsThe absolute value to reset the user's experiencePoints.
recalculateXPLevelWhether to reset the user's experienceLevel to the applicable level for the XP points being set. Use With Caution: If the user’s XP Level is lowered, stats and events awarded by previous level ups are not automatically withdrawn. You may wish to withdraw these awards (manually). Additionally, when this user levels up again, they will be awarded each of the level up awards once again.
skipResetIfUserXPPointsAlreadyLowerIf the given xp_points is HIGHER than the user's current experiencePoints, an error is returned if this is false; otherwise, if true, success is returned without any changes being made.

Usage

http://localhost:3000
// Cloud Code only. To view example, switch to the Cloud Code tab
JSON Response
{
"data": {
"xpCapped": false,
"experienceLevel": 1,
"sessionInvalidations": {
"invalidatedCount": 0,
"invalidated": [],
"verification": true
},
"experiencePoints": 200
},
"status": 200
}