I want to make it clone the map and move it to workspace and remove the other map from workspace. Though, this doesn’t seem to happen.
Here’s some parts of the commands script:
--// MAPS
local map1 = game.ServerStorage.Map1
local map1w = game.Workspace.Map1
local map2 = game.ServerStorage.Map2
local map2w = game.Workspace.Map2
--// CODE
function onChatted(msg, speaker)
if checkAdmin(speaker) then
local source = string.lower(speaker.Name)
msg = string.lower(msg)
if msg == "!changemap map1" then
map1:Clone().Parent = game.Workspace
map2w:Remove()
elseif msg == "!changemap map2" then
map2:Clone().Parent = game.Workspace
map1w:Remove()
end
end
end
game.Players.PlayerAdded:Connect(function(player)
player.Chatted:connect(function(msg)onChatted(msg, player) end)
end)
When I run the command “!changemap map1”, it doesn’t do anythin and doesn’t say an error in output.
Anything is appreciated, thanks!