Hello, I've been always been wondering how to load maps with the !run or :computer start command. Can anyone help me understand how to do this?
✓ ANSWER ACCEPTED
How to make a command that loads/ends maps?
1 answer
✓ Accepted answer
game.Players.PlayerAdded:connect(function(Player) -- Get the player when they join
if Player.Name == "richie177" then -- if the players name == an admin then continue
Player.Chatted:connect(function(Chat) -- Get every time that admin chats
if tostring(Chat:lower()):find("load/map1") then -- if the player chatted something with map in it
game.ServerStorage["map1"].Parent = game.Workspace
game.Workspace["lobby"].Parent = game.ServerStorage
elseif tostring(Chat:lower()):find("close/map1") then
game.Workspace["map1"].Parent = game.ServerStorage
game.ServerStorage["lobby"].Parent = game.Workspace
warn("Maps closed")
end
end)
end
end)
This discussion is preserved as it was. New answers, comments, and votes are closed.

6 comments
Do I copy everything but the green?
copy everything including the green, but you need to make the map in server storage named map1 and put something in workspace named "lobby" . Make sure to approve this as your answer if this helped!!
Ok so I got a mao and named it map1 and a place name lobby. Now what command do I say so when I say it, the map either disappears or loads?
you say load/map1 or close/map1. Make sure to approve this as your answer if this helped!
This does help but, if I want to add more maps, do I make a diffrent script, copy and paste the script you gave me and then change map1 to map2?
No, you just put another elseif and copy the whole thing i put under it and simply replace the names :-). Please accept the answer if this did help!