How to delete cloned map

i want to delete the cloned map at the end of the script

if RS.Map1Votes.Value > RS.Map2Votes.Value and RS.Map1Votes.Value > RS.Map3Votes.Value then
			chosenMaps.map1:Clone()
			chosenMaps.map1:Clone().Parent = workspace
			RS.Map1Votes.Value = 0
			RS.Map2Votes.Value = 0
			RS.Map3Votes.Value = 0
		elseif RS.Map2Votes.Value > RS.Map1Votes.Value and RS.Map2Votes.Value > RS.Map3Votes.Value then
			chosenMaps.map2:Clone()
			chosenMaps.map2:Clone().Parent = workspace
			RS.Map1Votes.Value = 0
			RS.Map2Votes.Value = 0
			RS.Map3Votes.Value = 0
		elseif RS.Map3Votes.Value > RS.Map1Votes.Value and RS.Map3Votes.Value > RS.Map2Votes.Value then
			chosenMaps.map3:Clone()
			chosenMaps.map3:Clone().Parent = workspace
			RS.Map1Votes.Value = 0
			RS.Map2Votes.Value = 0
			RS.Map3Votes.Value = 0
		end

it not the whole script there are is more code after this

local maps = {"map1", "map2", "map3"}

for i, mapName in pairs(maps) do
    local map = game.Workspace:FindFirstChild(mapName)
    if map then
        map:Destroy() 
    end
end

map1 map2 and map3 change each round

thats okay insert this script it will do loop and check which map is in workspace and then destroys it

i put the map in a folder then deleted everything in the folder at the end

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.