Search the docs

Find a guide, global, type or member

GlobalEmber

score

Scores kept per objective ("score" when omitted), for the length of the match. A target is a Player (kept by UUID, listed by name) or any name of 1 to 64 characters. At most 64 objectives of 4096 entries each.

Functions

score.get(target: Player | string, objective: string?) -> number#

Returns the target's score, 0 when it has none.

score.set(target: Player | string, value: number, objective: string?) -> number#

Sets the target's score and returns it.

score.add(target: Player | string, delta: number?, objective: string?) -> number#

Adds delta (default 1) and returns the new score. Use a negative delta to subtract.

score.remove(target: Player | string, objective: string?) -> boolean#

Removes the target from the objective. Returns whether it was there.

score.reset(objective: string?)#

Drops the whole objective.

score.rank(target: Player | string, objective: string?, ascending: boolean?) -> number#

Returns the target's 1-based rank, highest first unless ascending; ties go by name. 0 when absent

score.top(limit: number?, objective: string?, ascending: boolean?) -> { ScoreEntry }#

Returns up to limit (1..1000, default 10) entries, highest first unless ascending.

score.setTitle(objective: string, title: string)#

Sets an objective's display title. Nothing shows it yet.