Destroy() isn't working for me?

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I want to make that there is a map rotation but when the timer is done the map needs to get destroyed.

  2. What is the issue? Include screenshots / videos if possible!

    local mapModels = mapSave:GetChildren()
	local mapChoose = mapModels[math.random(1,#mapModels)]
	local mapSpawn = mapChoose:Clone()
	mapSpawn.Parent = workspace	
	roundProgressBoolian.Value = true

Here is the script to clone and place the map in the position I want it to be
But later on, I want to delete the folder with the models in it so I wanted to use destroy:


But in the output, it says that Destroy() isn’t a valid member of game.Workspace.[Folder Name]
What do I need to do? Please help me out!

You could loop through everything within the folder and destroy the models.

for _,Model in pairs(mapSpawn:GetChildren()) do

But is the folder then still in the workspace?

Can u upload your whole script?

1 Like

I’m not actually sure if you can delete the folder itself.
But what I would try is parent the folder to a part, then delete that part.

1 Like