So I’m trying to make something where it prevents models from loading in when the player joins the game. But I want the model to be used later. Although, I want to use server scripts so everything that’s happening in the map replicates to everyone else on the map so I can’t just pass on the map to the client. |
So my question is, how can I prevent models from loading in for a player when they join, but with the server script working for everyone else
Edit: And yes, I’ve tried a local script a player starts out with but the maps I’m using are fairly large so it’ll lag if not crash the player if say 10 maps are loaded at once.
Edit 2: Sorry I forgot to mention, if a map is being used it’s already in the workspace and multiple maps can be used at once so when a player joins they’re all loaded in for the player, in this case for the players I only want 1 map loaded in at a time
You can keep each map in a folder in ReplicatedStorage, and once a certain map is needed, you could simply just change the Parent of the map Folder to the Workspace, same goes for getting rid of a map, just Parent it back to ReplicatedStorage.
But the problem is I want server scripts supported so that anything that happens in the map is replicated to everyone else, those people being people already on the map or people coming to the map in the future. So if I load a map using a local script (in which I’m doing) then the server script wont work.
That’s where I can store my maps but when a player arrives at a map I use a local script to bring that map to the workspace, hence, 1 map at a time is loaded for a player. When a map is used it’s in the workspace so it replicates to everyone who’s on the map. But the problem is multiple maps can be used, so multiple maps are in the workspace, and when a player joins it loads all those maps which causes really bad lag.
So use ReplicatedStorage, and store all the maps, then as a loading screen progresses, load them in 1 by 1, or union parts together to create fewer parts. Always try to have less than 5K parts in any game.