Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to make a command that loads/ends maps?

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?

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)

6 comments

0

Do I copy everything but the green?

0

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!!

0

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?

0

you say load/map1 or close/map1. Make sure to approve this as your answer if this helped!

0

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?

0

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!

This discussion is preserved as it was. New answers, comments, and votes are closed.