question

Ozan Yilmaz avatar image
Ozan Yilmaz asked

How to get a random player to make a lottery system in the game?

Hello everyone,

I am thinking of making a lottery system to give some players gifts in the game. To be able to do that, I need to get a random player/s from the database. Getting a random player from all those players probably will be a heavy task, so that I am thinking of getting a random player from the players who were active last month. Is there a way to implement this feature?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Seth Du avatar image
Seth Du answered

You may use Leaderboard to achieve the requirement. You may generate a random number according to the amount number of players. Then call GetLeaderboard API with StartPosition property set as the randomly generated number in the request.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

Thank you for the answer

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.