How do I load and un-load multiple maps for certain players

Basically what I mean is how do I get it so for Ex: when a player enters a Obby/Map it will load in for them but for everybody that didn’t go through the teleport to that Obby it remains unloaded unless they go in and when the player teleports out of the map or leaves the map for that instance the map unloads for them. I know that TOH has done this to prevent lag but this has been confusing me for a while and I cant find a helpful tutorial on this. I know I have to put the maps in replicated storage and have to do something with Instance but I might be wrong…

Possible solution I’m wondering is would it reduce lag if I just made all the maps invisible for the player instead of unloading them

One thing that really confuses me in this is how would I make it so the maps unloading and loading is based locally on each player cause I don’t want multiple maps to be loading in and un-loading if there’s multiple players…

Basically when the player enters a map it will load in and when they leave it will unload for them and this goes for all players

Thanks for your help!

1 Like

U must try server storage i guess as i have seen it mostly used

1 Like

I’ve never done something like this, but if I were going to I’d do this:

  • Player enters teleporter and invokes remotefunction, sending what map the player is entering
  • Server clones the map from serverstorage, places it into replicatedstorage, returns the map info to player
  • Player clones the map from replicatedstorage, places it into workspace, fires remoteevent telling server to destroy the map in replicatedstorage
  • Server destroys replicatedstorage map
  • Player now has local copy of map, but this also means that other players can’t interact with other players’ versions of the map

Again, never done this before, this is just how it’s planned from the top of my head. Will it work? Maybe. Is it efficient? No clue.

I am implementing multiple maps into my game and have been following this Roblox API:

I have it so that the players teleport to different maps using the players GUI and they load up completely different places within the same experience.

It is simple enough to set up and works really well (atleast in my application).