CoreScripts aren’t guaranteed to be setup and running before normal scripts run. This can lead to core functions being called before they are registered, causing errors and requiring sloppy workarounds.
Function: StarterGui:WaitForRegisterGetCore(string parameterName, double timeOut) Function: StarterGui:WaitForRegisterSetCore(string parameterName, double timeOut)
Works like WaitForChild. Waits until a core function has been registered. Has optional timeout argument.
- More convenient for CoreScript engineers; no changes to CoreScripts are required.
- Less convenient for developers; each core function must be checked.
Function: StarterGui:FinishCoreRegistry() Function: StarterGui.IsCoreRegistryFinished() Event: StarterGui.CoreRegistryFinished()
The event is fired after registry is finished. Core functions cannot be called until registry is finished. New core functions cannot be registered afterwards.
- Less convenient for CoreScript engineers; CoreScripts must be reworked to make sure all core functions are properly registered before finishing.
- More convenient for developers; they only have to check one value.
- Access to all core functions depends on the core function slowest to register.
Function: StarterGui:PreregisterGetCores(Array parameterNames) Function: StarterGui:PreregisterSetCores(Array parameterNames)
Preregisters a list of names that will eventually be registered. Calling GetCore or SetCore on a preregistered but unregistered name waits until the core function has been registered before resuming normally.
- Less convenient for CoreScript engineers; must keep track of core functions in multiple locations.
- More convenient for developers; no changes are required.
- Core functions must be preregistered in a CoreScript that is absolutely guaranteed to run before any other script.