Is there any way to store player score on a db by refreshing the request every 5 mins?
What is a db?
I guess it’s data table
exactly, i was thinking about if theres any way to fetch it
By “db” do you mean a “database” something like MySQL, Redis, or Cloud Spanner?
If so, no, you should never talk directly to a database from a game client, because this will open your database up to easy attack from any hacker.
The minimum you should do is build a web service, where players post requests, you validate the request somehow, and then update the database from the web service. This means that the attack surface is limited to whatever your web service allows the player to do, not the full database capability.
You can POST JSON to a web service using the built-in HTTP client. There’s a community tutorial here:
If by “db” you mean something else, then obviously this answer doesn’t apply.