How would you implement a map system where the player chooses a map in the main game, and then when they choose that map it moves them to a different place? For example:
Main game
-Place 1
-Place 2
-Place 3
Player chooses place 2 and then it teleports them to place 2.
I’m asking this question because I feel like you would have to rewrite the code for each place, right? Is there a way to use the same code in between all the places? Because the only thing I want to change for each place is the map.
Note: I was originally going to store the maps in ServerStorage and then load each map based on whichever one gets picked, but the maps have terrain on them, so I have to separate each map into a different place
Thanks, but I know you’d have to use teleportation service, my question is about sharing the same codebase between each place, so that I don’t have to rewrite everything in each place. The only thing I want to change between places is the map, I want all the code to be the same
You can use packages. It allows you to make changes to Instances (including scripts) under some ancestor (like a folder or model) and have the changes easily sync-able across places. There’s an Update All feature that dispatches a package update to all places that use it and saves them. You’ll still need to publish each place once it’s saved.
Sorry for necroposting, but it’s best if you make like multiple maps in the same place as an option
separate places are gonna get messy, so best avoid that.
anyways, you could make a script that cycles through maps in a folder/group ig (note: i don’t do scripting so don’t ask for advice pls )
Just make it:
E.g. one folder just gets chosen
Map 1
Map 2
etc.
If you want terrain with it, you can use the terrain saver/loader plugin and reference that in the script i assume
Note: I was originally going to store the maps in ServerStorage and then load each map based on whichever one gets picked, but the maps have terrain on them, so I have to separate each map into a different place
This is just like a normal teleport, just set it to the place ID. Then have a script in each place if you want to teleport back to the main game. The main game would have an option for each place or one script for each place.