How do I load maps that contain terrain?

I’m currently working on a game, and I’ve already finished developing my own map voting system. All that’s left for me to do is load those maps based on the votes.

I know how to load maps without terrain, but all of my maps will include terrain. How can I achieve this?

1 Like

CopyRegion

PasteRegion

2 Likes

local terrainRegion = workspace.Terrain:CopyRegion(workspace.Terrain.MaxExtents)
workspace.Terrain:Clear()
task.wait(5)
workspace.Terrain:PasteRegion(terrainRegion, workspace.Terrain.MaxExtents.Min, true)

I’m gonna try these, thanks for the replies.

I’ll post back to update if it worked or not.

Something about not working script wrong give kat


-- Place this script in a ServerScript or a LocalScript depending on your needs

-- Reference to the Workspace where the map will be loaded
local workspace = game:GetService("Workspace")

-- ID of the place (game) containing the map you want to load
local placeId = YOUR_PLACE_ID_HERE  -- Replace with your actual Place ID

-- Function to load the map
local function loadMap()
    -- Load the place with the given Place ID
    local success, errorMessage = pcall(function()
        game:GetService("TeleportService"):Teleport(placeId)
    end)
    
    if not success then
        warn("Failed to load place:", errorMessage)
    end
end

-- Call the function to load the map
loadMap()

-- After the map has loaded, you might want to handle terrain specifics
-- For instance, adjusting lighting, camera, or other settings

-- Example of adjusting the lighting after loading the map
local function adjustLighting()
    local lighting = game:GetService("Lighting")
    
    -- Example of setting lighting properties
    lighting.OutdoorAmbient = Color3.fromRGB(128, 128, 128)
    lighting.Ambient = Color3.fromRGB(128, 128, 128)
    lighting.Brightness = 2
end

-- Call the function to adjust lighting (or any other post-loading adjustments)
adjustLighting()

is that chatgpt?

1 Like

Maybe working try now something

Yeah don’t listen to them. Chat GPT is dumb. Just study the documentation I provided and you’ll be good to go.

1 Like

You are again give you fake that

This script only copies and pastes the current terrain but for my game to function I require multiple terrains. My original question is how can I load different maps with different terrain.

With all due respect, sir, you are saying complete nonsense that doesn’t make any sense. It seems you aren’t native to english at all. Please use a translator app.

2 Likes

But you can try it now it will be worth the script. You just add it and then you can go to go.

You could copy the terrain (not in play test) to get a TerrainRegion instance which then you can use to load the terrain.

At Catsby is not working but you got wrong

I dont know what you’re trying to say.

Yeah, I don’t know about how to say like sometimes I forgot to speak my English

I know, this only gives me the current terrain. I need multiple different terrains loaded based on the map picked.

Why am I thinking is bad about this?

Yeah… so you can just use the same thing to copy the terrain and load it!? Did you read the documentation at all!?


2 Likes