How to change maps on gui

hello robloxians I’m making some more additions to my game and I want to make a gui to change into infinite different maps as many as I cant make and add but, I cant seem to figure out where to find a tutorial or any help so I’m coming here for help.
I’ve organized my map here is what my area looks like

and this is what the game itself looks like


my goal is for a gui to pop out in the top area with a side scroll

I’ve made all the possible areas I want it to appear but I’m determining on where mainly the top where its circles
ik this isn’t much and I’m sorry but I really don’t know what I’m doing in this territory of game development

2 Likes

I’m not really sure what you are having trouble with.

Do you need a gui that pops out from the side? Check out Tween (roblox.com)

Do you need to teleport the player to another part of the map? Check out Teleporting Within a Place (roblox.com)

Do you need to teleport the player to another game? Check out TeleportService (roblox.com)

im trying to describe like changing maps on click like beat up simulator and arsenal when the round is over

You might be able to store the other maps somewhere else, (preferably ServerStorage) and then when the round is over, delete the current map, and then clone the new map from ServerStorage

1 Like

how would i manage to do that? im not very fast minded when it comes to scripting sorry

Have a model containing the map in workspace, e.g. “MapContainer”

In ServerStorage, there would be a folder named “Maps”, in that folder contains a bunch of models, each one corresponding to a map.

When the round ends, call ClearChildren on MapContainer and then randomly pick and Clone a map from ServerStorage.Maps and Parent it to workspace.MapContainer.

Apologies for my bad explaining skills.

1 Like

very sorry for the late response but how would i make it sync to a button click on a gui? as many times as i want would i be in separate scripts? idk sorry :frowning:

Do you want to make a vote system or just teleport a player if it clicks on a button or maybe something else?

2 Likes

i just want it to switch out when the player clicks a button and make it so only 1 player sees it at a time not teleport

Then just make a click event with the button:

local Players = game:GetService("Players")

local Client = Players.LocalPlayer

repeat wait()

until Client.Character -- I make this because CharacterAdded isn't working anymore

local Character = Client.Character

local Button = script.Parent

local PartToTeleport = workspace.Part -- Put here the explorer location of the part you want to teleport to

Button.MouseButton1Click:Connect(function()
    Character:SetPrimaryPartCFrame(PartToTeleport.CFrame)
end)
2 Likes

thank you for that! but how would i make it switch to the map and specifically the map i want?

Make a part inside the workspace with the position you want to teleport to and name it something like “Map2Spawn” whatever your name is put it at the end of this variable

1 Like

does that keep the map clean like change just the objects with some new ones and change the skybox cause i made a folder for the selected parts i want to go away and come back

Can you show me that folder and their children in the explorer?

1 Like

this is my entire explorer for the game PctkfgQ

Where is the folder you talked me about?

1 Like

it would be called first office it has all the parts for the first map just not the skybox and lighting

1 Like

Oh alright, inside the folder put a Part with the position you want the player to go, name it Reference and then just edit the script like this:

local Players = game:GetService("Players")

local Client = Players.LocalPlayer

repeat wait()

until Client.Character -- I make this because CharacterAdded isn't working anymore

local Character = Client.Character

local Button = script.Parent

local PartToTeleport = workspace["first office"].Reference

Button.MouseButton1Click:Connect(function()
    Character:PivotTo(PartToTeleport.CFrame)
end)

And that would be it for that map, you can do the same with the rest of them by just editing the “PartToTeleport” variable with the name of the folder.

1 Like

so how would i work if you don’t mind walking me through on what it will do? thanks a bunch too btw

Sure, first you’re getting the player and its character, so you know it is a LocalScript. Then you make 2 variables which localize the button that gets clicked and localize the part on where player needs to get teleported. And lastly we make a function which will trigger when the button it’s clicked and will make the player’s character teleport to the part.

1 Like