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

How do I remove everything but one model?

Asked by 8 years ago

I want to remove everything but I want to keep just one model?

-They are all in workspace.

2 answers

Log in to vote
0
Answered by 8 years ago

Easy peasy.

local stuff=workspace:GetChildren()

for i,v in pairs(stuff) do
    if v.Name~="MegaBaseplate" then
        game:GetService("Debris"):AddItem(v,.5)
    end
end
Ad
Log in to vote
2
Answered by
Spoookd 32
8 years ago
for i, v in pairs(game.Workspace:GetChildren()) do
    if v.Name ~= "MegaBaseplate" and v.Name ~= "Terrain" then
    v:Remove()
    end
end

Answer this question