Legacy Documentation: Version 5.0
Language: English
  • C#
  • JS

Script language

Select your preferred scripting language. All code snippets will be displayed in this language.

Social.ReportScore

Switch to Manual
public static function ReportScore(score: long, board: string, callback: Action<bool>): void;

Parameters

Description

Report a score to a specific leaderboard.

#pragma strict
function ReportScore(score, leaderboardID) {
	Debug.Log("Reporting score " + score + " on leaderboard " + leaderboardID);
	Social.ReportScore(score, leaderboardID, function(success) {
		Debug.Log(success ? "Reported score successfully" : "Failed to report score");
	}
	);
}