onSynced
This event is triggered when a script is synced with the server.
Usually when assets, player information, and other data is synced with the server.
If you're using the initEngine
or initReactEngine
(Client), you don't need to worry about handling the onSynced
event. This is because the function internally waits for the onSynced
event to be triggered before resolving the promise.
Example
engine.events.on('onSynced', () => {
console.log('Script is fully synced with the server!');
// now you can use engine.localPlayer, engine.objects, etc safely.
});
Available on: Client Server