Skip to content

Scores Module

Lucas E. da Silva edited this page Apr 13, 2026 · 2 revisions

📈 Scores Module

The Scores service manages leaderboards and high scores. You can have multiple score tables for different levels or game modes.


🛠️ Functions

scores_add(require_user: bool, score: String, sort: int, table_id: int = 0, guest: String = "", extra_data: String = "") -> Variant

Submits a score to the Game Jolt servers.

  • require_user: If true, the score is linked to the authenticated user.
  • score: The display string (e.g., "1,200_gold").
  • sort: The numerical value for ranking (e.g., 1200).
  • table_id: (Optional) The ID of the specific leaderboard.
  • guest: (Optional) Used if require_user is false to submit a score for a guest player.
  • extra_data: (Optional) Extra string data associated with the score (like player build or character).

scores_fetch(require_user: bool, table_id: int = 0, limit: int = 0, better_than: int = 0, worse_than: int = 0, guest: String = "") -> Variant

Retrieves a list of scores from a leaderboard.

  • limit: How many scores to return (maximum 100).
  • better_than/worse_than: Used to fetch scores around a specific numerical value.

scores_get_rank(sort: int, table_id: int = 0) -> Variant

Returns the rank of a specific score value on the leaderboard.

  • sort: The score value to check.

scores_table() -> Variant

Lists all the score tables available for the game.


💡 Example Usage

Submitting a User Score

await GameJoltAPI.scores_add(true, "500_points", 500)