Hello everyone,
I have an issue I don't know how to handle yet, maybe someone here can help me?
I have a Cloud Script function that creates some content in the PlayerData of a player, and I would like to update this data after X minutes calling another Cloud Script automatically.
What I'm looking for seems similar to scheduled tasks, except that I would like to call it from a Cloud Script.
Do you know how I can do that?
Answer by Sarah Zhang · Aug 15, 2019 at 08:40 AM
It seems not the best workaround that calling a scheduled task from a Cloud Script. Firstly, We can’t do the delayed call on Cloud Script. There is a limit of Cloud Script execution time. It’s for 4.5 seconds. You can navigate to [Game Manager]->[Settings]->[Limits] to check it. Cloud Script also can’t use the admin API RunTask. Recurring Scheduled Task is not suitable for such usages too.
A possible workaround of your case is implementing a timer function on the server or client. In most applications, it’s better to implement delayed calls on the server. But if you don’t have a custom server. You can try to do delayed calls to CloudScript on the client. However, if we do it on the client, there is a risk that the user may disconnect accidentally. We should write some verification functions to handle it.