Guest User

convert WedgeParts to wedge meshes

a guest
Oct 17th, 2020
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.26 KB | None | 0 0
  1. --RUN THIS IN MODERN ROBLOX STUDIO
  2. --NOTE: this does not save any children of WedgeParts
  3.  
  4. for _, old in pairs(workspace:GetDescendants()) do
  5.     if old:IsA("WedgePart") then
  6.         part = Instance.new("Part")
  7.         mesh = Instance.new("SpecialMesh")
  8.        
  9.         mesh.MeshType = Enum.MeshType.Wedge
  10.         mesh.Parent = part
  11.        
  12.         part.BrickColor = old.BrickColor
  13.         part.Material = old.Material
  14.         part.Reflectance = old.Reflectance
  15.         part.Transparency = old.Transparency
  16.         part.Size = old.Size
  17.        
  18.         if old.Anchored == true then
  19.             part.Anchored = true
  20.         end
  21.         if old.CanCollide == false then
  22.             part.CanCollide = false
  23.         end
  24.         if old.Locked == true then
  25.             part.Locked = true
  26.         end
  27.        
  28.         part.BackSurface = old.BackSurface
  29.         part.BottomSurface = old.BottomSurface
  30.         part.FrontSurface = old.FrontSurface
  31.         part.LeftSurface = old.LeftSurface
  32.         part.RightSurface = old.RightSurface
  33.         part.TopSurface = old.TopSurface
  34.        
  35.         part.Name = old.Name
  36.         part.Parent = old.Parent
  37.         part.CFrame = old.CFrame
  38.        
  39.         print("replaced", part.Name)
  40.         old:Destroy()
  41.     end
  42. end
Advertisement
Add Comment
Please, Sign In to add comment