Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local destroymeshes = false -- not reccomended cant bring them back
- local destroymeshpart = true -- will not destroy meshes will only destroy MESHPARTS (can bring back)
- local removematerial = true -- everytime this is true and ran it will overright the old material (so if you want to keep this but not meshparts set it to false first)
- for i,v in pairs(workspace:GetDescendants()) do
- if v.ClassName == "Part" and removematerial == true then
- local oldmat = Instance.new("StringValue", game.ReplicatedStorage)
- oldmat.Name = v.Name
- oldmat.Value = v.Material.Name
- end
- end
- for i,v in pairs(workspace:GetDescendants()) do
- if v.ClassName == "MeshPart" and destroymeshpart == true then
- v.Transparency = 1
- V.CanCollide = false
- elseif v.ClassName == "MeshPart" and destroymeshpart == false then
- v.Transparency = 0
- V.CanCollide = true
- end
- if v.ClassName == "Part" and removematerial == true then
- v.Material = "Plastic"
- elseif v.ClassName == "Part" and removematerial == false then
- local joe = game.ReplicatedStorage[v.Name]
- v.Material = joe.Value
- joe:Destroy() --deletes the value because there may be thousands of values in replicated storage
- end
- if v.ClassName == "Mesh" and destroymeshes == true then
- V:Destroy()
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement