Hey guys I need Simple Help on this Code

You can see here a code for random map selection
What I need is there’s way to make the code Choose the map I want instead of the random selection?
Hope you Help me!
Hey guys I need Simple Help on this Code

You can see here a code for random map selection
What I need is there’s way to make the code Choose the map I want instead of the random selection?
Hope you Help me!
If you know the name of the map, you can do
local MapName = "TheMapNameYouWantToChooseHere"
local ChosenMap = MapsFolder:FindFirstChild(MapName)
--// Then you can check like
if ChosenMap then
print("Map found")
else
print("Map does not exist")
end
Edit: Fixed code error, thanks @AridFights1 for the catch
can you specify? if what you want is a map selection system you need many more things

hmm… It’s still didn’t work
I don’t need map selection system
All I need is choosing map with the name instead of the random selection
Check the 1st reply to this post. That’s the solution. All you need to do is change the string to the map name you want.
Edit: I did found a mistake in the code of that reply. Here’s the fixed one:
local MapName = "TheMapNameYouWantToChooseHere"
local ChosenMap = MapsFolder:FindFirstChild(MapName)
--// Then you can check like
if ChosenMap then
print("Map found")
else
print("Map does not exist")
end
If you, for example, want to select a map via a GUI or command line from the client you need a RemoteEvent for this. This is mainly because you might want to change the map while playing instead of hardcoding it with a variable.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage.RemoteEvent
local AvailableMaps = MapsFolder:GetChildren()
local ChosenMap = nil --you can set this to a default map if you want
RemoteEvent.OnServerEvent:Connect(function(MapName) --executes this function when the event is fired from the client
ChosenMap = AvailableMaps[MapName]
--do the rest of your code here if you need to
end
Keep in mind this can be abused by exploiters if they have access to whatever you have planned for a map selection from the client, you may need to do some changes if that is the case.
Thanks you so much It did work!
Ain’t no problem mate! We all make mistakes, and that’s how we grow!
Thanks for the Help @https_KingPie