Hi, I have a script already that my friend made me... Its purpose was to remove all the meshes from my world, only issue is that it only removes it from un-grouped meshes... Could anybody help? here is the script: function check(part) if part:IsA("Mesh") then part:Destroy() else for i, v in pairs(part:GetChildren()) do check(v) end end end
I need the script to search through everything on my world, IE. through groupings of blocks and then meshes attached to those blocks...
Thanks so much for the help!
function RemoveMesh(Object) for _,v in pairs(Object:GetChildren()) do if v.ClassName == "SpecialMesh" or v.ClassName == "CylinderMesh" or v.ClassName == "BlockMesh" then v:Destroy() end RemoveMesh(v) end end
You would call the function like this:
RemoveMesh(--[[Place the path to the brick here]]--) --Example: RemoveMesh(game.Workspace.Model)
Here is a script that I'd probly use to remove Meshes;
c = workspace:children() for i=1,#c do if c[i].className=="MESHCLASSNAME"then c[i]:remove() end if c[i].className=="Model" or c[i].className=="Part" then ci=c[i]:children() for i2=1,#ci do if ci[i2].className=="MESHCLASSNAME"then ci[i2]:remove() end end
But your also using a function.. So..
c=workspace:Children() CleanUp=true if CleanUp then function Clean() for i=1,#c do if c[i].className=="MESHCLASSNAME"then c[i]:remove() end end end elseif not CleanUp then print("Set CleanUp to true for CleanUp") end CleanUp() --Forgot to add this, sorry.
Sorry if this was not what you were looking for.