Leaderboards.setScoreForPlayer error
Hello,
I am just trying to call setScoreForPlayer, but getting and error sayinng that I am passing the server player when I'm pretty sure I'm not. Eitherway, what is the proper way to call this?
I have the System->Leaderboards->WorldLeaderboard1 and a worldlbgizmo also called WorldLeaderboard1 that points to the systems leaderboard.
//const lp = this.world.getLocalPlayer(); // tried this one first. error server player?
const lp = this.entity.owner.get(); // same here error server player
if ( lp )
{
this.world.leaderboards.setScoreForPlayer("WorldLeaderboard1",lp,score,false );
}
Again getLocalPlayer and my local script this.entity.owner.get() also gets this same "server player" error.
Actually I figured out a way to do this. I made a new script, set that to local, and then call the function in that script to call setScoreForPlayer. That is working now. So if you're running into this issue... just handle the lb update in a separate local script and that should be fine.