How do you save player data like money and XP so that it doesn't reset when you leave in Rec Room custom rooms?

There are several rooms out there that have money or XP stats that don't get reset when you leave the room. Players can earn XP and money by playing the game, then when they return to the room at a later time, it restores all of their stats. How is this possible and how can I build something like that in my room?


This can be done by using the Leaderboard Chips (Get Leaderboard and Set Leaderboard), it lets you save up to 3 different stats per player, then using the Get Leaderboard Chip, it lets you take that data back even if the player left the room and such. You could save XP by using the increment function on a Set Leaderboard by configuring it and then send a player ID to get said value with a Get Leaderboard and compare it to see if they have enough XP to Level Up or etc. Leaderboard Chips save 3 stats that are persistent across subrooms as well.

In the case of saving XP for every players once a game ends, you could simply set every players on Team 1 and increment Team Indexes to get the IDs of everyone and give them XP as a Leaderboard Stat, this is how it's done in Tudor Mansion. As to get it on command back, you could add a Player Joined Event to get the player's XP Stat on room launch, etc.