How do I make a map Loader?

Hello, Im currently creating an unnofficial Futuretops type of game with a specific gun system.
I currently use the Kohls admin. But I don’t know how to make a command that loads maps.

1 Like

You can simply store the map model in serverstorage/replicatedstorage and clone it when firing that command.

Here’s the simple idea behind it -

local Map = game:GetService("ServerStorage").MapModel

local function LoadMap()
  --checking if that map already exists in workspace or not
  if game.Workspace:FindFirstChild(Map.Name) then
    game.Workspace:FindFirstChild(Map.Name):Destroy()
  end
  local clone = Map:Clone()
  clone.Parent = game.Workspace
end

game.ReplicatedStorage.Remotes.LoadMapEvent.OnServerEvent:Connect(function(Player)
   LoadMap()
end)

[Here I assume you’re firing command from the client, and the impact will be done on the server, thats why the remote.

1 Like

Where do I put that script like into custom commands or?