Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do I make it so model contents don't dissapear? [SOLVED BY ME]

Asked by 4 years ago
Edited 4 years ago

Here is my code:

function generateMap()
    -- The map is named "A" so I can see it first thing.

    -- Get Rid of last map in "Map" Model.
    workspace.A:ClearAllChildren()

    -- Generate the biome
    local y
    local x

    -- We have a start and it's easier to keep track of it in a variable.
    local startOfMap = Vector3.new(-144.5, 0.5, 87.5)

    -- Start the loop for generating the biome.
    for y=1, 10 do
        for x=1, 10 do
            local part = Instance.new("Part")
            part.Parent = workspace.A
            local Y = -144.5 + (x * 25)
            local X = 87.5 + (y * 25)
            part.Size = Vector3.new(25, 1, 25)
            part.Position = Vector3.new(X, 0.5, Y)
            part.Material = "Grass"
            part.Color = Color3.new(0, 255, 0)
            part.Anchored = true
        end
    end
end

generateMap()

If there is something I can do, please say so. I've been struggling to find an answer. After a few seconds, it disappears.

1
Can you be a bit more precise about what's going on? The contents dissapear instantly or just after a few seconds later? User#27525 1 — 4y
0
Tested the script on studio, and it seem to be fine. Is there any other script interfering with this one? User#27525 1 — 4y
0
I have found the answer ILostMyAccount2Tims 0 — 4y

Answer this question