04-21-2025 08:04 AM - last edited on 04-21-2025 10:41 AM by SeeingBlue
import * as hz from 'horizon/core';
export class TriggerScoreUpdater extends hz.Component<typeof TriggerScoreUpdater> {
start() {
this.connectCodeBlockEvent(this.entity, hz.CodeBlockEvents.OnPlayerEnterTrigger,
(enteredBy: hz.Player) => {
console.log(`Player ${enteredBy.name.get()} set leaderboard to 42`);
this.world.leaderboards.setScoreForPlayer("test", enteredBy, 42, false);
}
);
}
}
hz.Component.register(TriggerScoreUpdater);
Solved! Go to Solution.
04-26-2025 07:16 AM
I think there is a setting in your horizon menu that lets you exclude yourself from leaderboards.
04-21-2025 10:50 AM - edited 04-21-2025 10:53 AM
Everything appears correct, also worked for me. I invited you as a editor to the world.
04-26-2025 01:38 AM
Thanks for the test. In facr my profil seems broken, people can update the leaderboard, but not me. I'm in holidays but i will test your world when i can, i suppose that i won't appeare in your leaderboard.
04-26-2025 07:16 AM
I think there is a setting in your horizon menu that lets you exclude yourself from leaderboards.
04-27-2025 07:37 PM
can you also invite me - it'd be nice to learn from a working example of this!