I’ve been looking for ways to code more efficiently in order to allow low end devices to run games well. I’ve loaded maps on the client, and I’ve accomplished that through the following steps:
- Player clicks a door and the client invokes the server.
- The server copies the requested map to the player’s backpack and informs the client when it’s done.
- The client copies the map to the workplace and then fires the server to delete the map from their backpack.
- The server sees the client’s request and fulfills it.
- The client deletes any maps that exist in the Workspace except the one that they are on.
So now the map is loaded on the client. But there are portals and doors to other maps on the map that need code to function. How would I get code going that would allow the player to touch those portals or click those doors and then repeat the steps above? Decorations on the map may also require code to work, and neither local scripts or server scripts will work when place inside the object cloned to the client.
Anything on the client’s map that requires code to run won’t run unless a method is implemented, and all I can think of is utilizing local scripts in PlayerScripts that wait for the portal to exist but to use WaitForChild since they’ll issue warnings after the timeout period is over. Is it possible to use a value.changed event? If so, how?