Advertisement
HansCSia320

FPS Booster

May 22nd, 2020
2,368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.32 KB | None | 0 0
  1. local destroymeshes = false -- not reccomended cant bring them back
  2. local destroymeshpart = true -- will not destroy meshes will only destroy MESHPARTS (can bring back)
  3. 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)
  4.  
  5. for i,v in pairs(workspace:GetDescendants()) do
  6.    if v.ClassName == "Part" and removematerial == true then
  7.   local oldmat = Instance.new("StringValue", game.ReplicatedStorage)
  8.   oldmat.Name = v.Name
  9.   oldmat.Value = v.Material.Name
  10.  end
  11. end
  12.  
  13. for i,v in pairs(workspace:GetDescendants()) do
  14.    if v.ClassName == "MeshPart" and destroymeshpart == true then
  15.        v.Transparency = 1
  16.        V.CanCollide = false
  17.        elseif v.ClassName == "MeshPart" and destroymeshpart == false then
  18.          v.Transparency = 0
  19.  V.CanCollide = true
  20.    end
  21.    if v.ClassName == "Part" and removematerial == true then
  22.        v.Material = "Plastic"
  23.    elseif v.ClassName == "Part" and removematerial == false then
  24.        local joe = game.ReplicatedStorage[v.Name]
  25.            v.Material = joe.Value
  26.            joe:Destroy() --deletes the value because there may be thousands of values in replicated storage
  27.    end
  28.    if v.ClassName == "Mesh" and destroymeshes == true then
  29.        V:Destroy()
  30.        end
  31.    end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement