BeamMP-Server icon indicating copy to clipboard operation
BeamMP-Server copied to clipboard

[Feature Request] onInitFinal - A event called when all lua states have been initialized

Open OfficialLambdax opened this issue 8 months ago • 0 comments

Is your feature request related to a problem? Please describe. When Lua states want to communicate with each other then they have to wait for the other to exist. So if a script wants to eg register, request or send data during eg onInit

MP.TriggerGlobalEvent("myEvent", "hey im here")

then this event will only reach the target state when it has been initialized already.

For example imagine a single state that manages all server wide script settings. Now each script state has to request that data, but has to make sure the options state is already present. Currently there is no way to ensure a or all states are fully loaded.

An event like onInitFinal that is fired once all states have been fully loaded and executed with onInit would solve this.

OfficialLambdax avatar Jun 10 '25 23:06 OfficialLambdax