That error occurs when you reach the rate limit for writing to datastores.
The standard rates are below, but may vary depending on your player count.
Rate limits and throttling | Documentation - Roblox Creator Hub
As for your code, it looks fine to me. I don’t see how it could be querying the datastore more than the rate-limits.