Hi, I have created statistics called EXP and Level. I would like to reward player certain amount of EXP after battle. Which function should I use to implement that?
Also I would like to implement so that after player accumulated certain EXP then the player will Level up and get reward such as gold currency, playable character, gift box, etc. Which function should I use to implement this feature?
Thank you for your help and support,
Best Regards,
Dennis
Active Dream
Answer by Sarah Zhang · Sep 03, 2019 at 06:28 AM
Firstly, you can learn about PlayStream Event, Rules and Cloud Script, then combine these functions to implement your features. About the possible workarounds we can give the following simplified steps:
>> I would like to reward player certain amount of EXP after battle. Which function should I use to implement that?
>> I would like to implement so that after player accumulated certain EXP then the player will Level up and get reward such as gold currency, playable character, gift box, etc.
Hi @Sarah Zhang
Thank you for your reply, could give example code for these steps please?
Thank you for your help and support
Best Regards,
Dennis
Active Dream
1. You can find the sample CloudScript code in your CloudScript revision1. You can also refer to the following code.
handlers.UpdateCurrentPlayerStatistics = function (args, context) { var request = { PlayFabId: currentPlayerId, Statistics: [{ StatisticName: "Exp", Value: 100 }] }; var playerStatResult = server.UpdatePlayerStatistics(request); };
2. You can refer to this doc.
Hi @Sarah Zhang,
Thank you for your help, I have implemented the cloud script successfully. By the way, how to promote and gain audience for the game that I developed?
Thank you for your help and support,
Best Regards,
Dennis
Active Dream
GrantItemsToCharacter gives VC to Player not Character? 1 Answer
Creating dummy player from cloud script 1 Answer
How can I change a players statistics ? 1 Answer
Avatars as inventory items 2 Answers