FBInstant.player.setStatsAsync
Available since: Gideros 2018.3
Class: Player
Description
Set stats to be saved to the designated cloud storage of the current player.
<syntaxhighlight lang="lua">
FBInstant.player.setStatsAsync(keyValuePairs,callback)
</source>
Parameters
keys-value-pairs: (table) A table containing a set of key-value pairs that should be persisted to cloud storage as stats, which can be surfaced or used in a variety of ways to benefit player engagement. The object must contain only numerical values - any non-numerical values will cause the entire modification to be rejected.
callback: (function) A function that will be called with two arguments: true or nil if the operation failed, and an error code if the function failed. NOTE: True does not necessarily mean that the input has already been persisted. Rather, it means that the data was valid and has been scheduled to be saved. It also guarantees that all values that were set are now available in player.getDataAsync
Examples
Example
<syntaxhighlight lang="lua">
FBInstant.player.setStatsAsync({level=5,zombiesSlain=27}, function(result,error)
if result then
print("data is set")
end
end)
</source>
- FBInstant.player.canSubscribeBotAsync
- FBInstant.player.flushDataAsync
- FBInstant.player.getConnectedPlayersAsync
- FBInstant.player.getDataAsync
- FBInstant.player.getID
- FBInstant.player.getName
- FBInstant.player.getPhoto
- FBInstant.player.getSignedPlayerInfoAsync
- FBInstant.player.getStatsAsync
- FBInstant.player.incrementStatsAsync
- FBInstant.player.setDataAsync
- FBInstant.player.setStatsAsync
- FBInstant.player.subscribeBotAsync