"OnOpen" event

I noticed that there’s an OnClose event and that’s amazing for saving data.

My current game is a universe based RPG (or Game/Universe) and it’s going very well with amazing feedback. One issue is that to manage the game, when a server starts, a script loads all data remotely from my models to populate the game. Such as the item database, all core scripts and all guis. The issue is that sometimes players join before this loads and spawn with no GUIs, etc.

Could we get an event that doesn’t declare a server “Ready” until an “OnOpen” event declares it ready? Thanks!

Yeah. I dont think this would solve anything.

Or you could upload your game with its content already included like you’re supposed to.

No… that’s not the issue.

If he’s using Universes and has Assets that need to be shared by all places, using InsertService makes more sense (because who wants to copy and paste the same Assets model for all their places?)
It’s what I do and I dont run into this at all.

The real issue is that by the time the server runs the scripts, “OnOpen” will have already fired.
Even if OnOpen did fire, it wouldn’t function any differently than scripts just running on their own without the event.

He just needs to learn to use WaitForChild.

No… that’s not the issue.

If he’s using Universes and has Assets that need to be shared by all places, using InsertService makes more sense (because who wants to copy and paste the same Assets model for all their places?)
It’s what I do and I dont run into this at all.

The real issue is that by the time the server runs the scripts, “OnOpen” will have already fired.
Even if OnOpen did fire, it wouldn’t function any differently than scripts just running on their own without the event.

He just needs to learn to use WaitForChild.[/quote]

I’m sorry, what?

Set Players.CharacterAutoLoads to false initially and then once you’re done loading everything, set it to true and call LoadCharacter on all existing players. This will solve your problem of players spawning before the game has fully loaded.

Set Players.CharacterAutoLoads to false initially and then once you’re done loading everything, set it to true and call LoadCharacter on all existing players. This will solve your problem of players spawning before the game has fully loaded.[/quote]

Thank you. I appreciate an actual answer. GollyGreg why are you trying to be so condescending? Bad day or is it me?

No… that’s not the issue.

If he’s using Universes and has Assets that need to be shared by all places, using InsertService makes more sense (because who wants to copy and paste the same Assets model for all their places?)
It’s what I do and I dont run into this at all.

The real issue is that by the time the server runs the scripts, “OnOpen” will have already fired.
Even if OnOpen did fire, it wouldn’t function any differently than scripts just running on their own without the event.

He just needs to learn to use WaitForChild.[/quote]I do this as well and have had no problems with it.

No… that’s not the issue.

If he’s using Universes and has Assets that need to be shared by all places, using InsertService makes more sense (because who wants to copy and paste the same Assets model for all their places?)
It’s what I do and I dont run into this at all.

The real issue is that by the time the server runs the scripts, “OnOpen” will have already fired.
Even if OnOpen did fire, it wouldn’t function any differently than scripts just running on their own without the event.

He just needs to learn to use WaitForChild.[/quote]I’ve been using the same methods for importing assets into my games, and haven’t had any problems either.

Then again, I’ve made sure that on the server - the server scripts wait for their dependencies to load before executing - and on the client, loading client scripts in a certain order. I have had no issues with it.

Set Players.CharacterAutoLoads to false initially and then once you’re done loading everything, set it to true and call LoadCharacter on all existing players. This will solve your problem of players spawning before the game has fully loaded.[/quote]
This is your best bet. GollyGreg had a good point saying that an OnOpen method isn’t really a good solution to this problem, a better thing would be for ROBLOX to actually implement something that makes cross-place instances possible. Hopefully they figure out some awesome way of achieving this in the future.

Until then, we have to resort to importing models. Question - how many models are you inserting?

I’m inserting around 5,000 parts right now however this will grow to around 30k-40k in the future. The RPG is huge with a large database. It’s also extremely popular, hitting 1,100 players within 5 hours of opening so people clearly love it, and I want to give them the best experience possible.

I closed the game to keep people thirsty while I add new content so I’m really happy Seranok’s solution seems to work. It means I can re-open faster.

What RPG are you working on?

Isn’t an OnOpen event already just a server script?

No. The server opens when it pleases giving us no control. And scripts aren’t events really. But I’ve fixed the issue thanks to Seranok.

But an .OnOpen event is the same as having a server script… it executes when the server starts.