Skip to main content

Scores

Api Documentation for LoudWolf.Scores

Save score

void save_score(player_name:String, score:number|ScoreID)

await LoudWolf.Scores.save_score(player_name, score)
tip

If you don't want to await the saving prefer using

LoudWolf.Scores.save_score_async(player_name, score)

Get highest scores

array[Score] get_scores(how_many:number)

var scores=await LoudWolf.Scores.get_scores(how_many)
info

If you don't specify how_many, you get the best 10 scores.

info

If you want to get all scores call get_scores(0)

This is a disabled functionality, because the SilentWolf host didn't provide theese things:

Get scores of specific player

array[Score] get_scores_by_player(player_name:String)

Returns all scores of the specific player.

var player_scores:= await LoudWolf.Scores.get_scores_by_player(player_name)
print("Got: " + str(LoudWolf.Scores.scores.size()) + " scores for player: " + str(player_name))

Get the top score for a specific player

Score get_top_score_by_player(player_name:String)

Returns the best Score for the specific player.

var score:=await LoudWolf.Scores.get_top_score_by_player(player_name)
print("Got top player score: " + str(score))

Find position of score in the leaderboard

int get_score_position(score:number|ScoreID)

var position := await LoudWolf.Scores.get_score_position(score|score_id)

Delete a score

void delete_score_async/delete_score(score_id: ScoreID, ldboard_name: leaderboard name)

LoudWolf.Scores.delete_score_async(score:ScoreID)
info

If you want to delete and wait for the delete use:

await LoudWolf.Scores.delete_score(score:ScoreID)
danger

There's no undo of this action.

Delete entire leaderboard

void wipe_leaderboard(name_of_leaderboard:String =main)

tip

Prefer using wipe_leaderboard everywhere with an argument

danger

There's no undo of this action.