Loading maps locally for each player, without using ReplicatedStorage

I’m trying to make a system where a player’s client can request a map, and it will be loaded from the server. My maps are stored in ServerStorage as to not make the client load the map when it is not needed. I do not want to use the workspace’s Streaming property, as there can be many, many maps.

One solution I’ve tried so far is sending a copy of the map through a RemoteFunction, however the Object property in this table is not sent to the client.

		local mapObject: Model = mapFolder.Map:Clone()
		local mapInfo = require(mapFolder.Info)
		clean(mapObject)

		mapTable = {
			Object = mapObject,
			Info = mapInfo,
			Size = #mapObject:GetDescendants() -- To help the client know when the map is loaded.
		}

(This table gets sent to the client without the Object field.)

I need to be able to dynamically load maps to individual players (no parenting to workspace), without needlessly loading maps that aren’t currently being played. Any help would be greatly appreciated.

The map object can not be sent to the client as it would return nil because it doesn’t exist on the client and the map exists in ServerStorage which the client can not see. May I ask you why are you not trying to use ReplicatedStorage to load the map via client? It would be the most efficient and the easiest thing you could do!

You could try to create the map on the server then firing a remote event to all clients, and checking if the Player is the requester of the map. If they aren’t then you would destroy the map but that wouldn’t be really efficient but that is the best thing you could possibly do.

I found a workaround where I can just parent the map to PlayerGui which will only replicate it for the specific player.

Why on earth would you use PlayerGui over ReplicatedStorage? You’re achieving the exact same result. The client can access ReplicatedStorage and you can load in and out maps via ReplicatedStorage pefectly fine. Using PlayerGui is so unnecessary.

I’m using PlayerGui so that it does not get loaded by all players, I only need one player to load the map.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.