This topic is unfinished: please wait it’s finished before answer or flag it.
Hello! I make a script who allow builders to create custom material easily.
for _, part in ipairs(script.Parent:GetDescendants()) do
if part:IsA("BasePart") then
local newPart = part:Clone()
newPart.Size += Vector3.new(0.001,0.001,0.001)
newPart.Material = script:GetAttribute("Material")
newPart.Transparency = script:GetAttribute("Transparency")
if script:GetAttribute("ChangeColor") == true then
newPart.Color = script:GetAttribute("Color")
end
newPart.Parent = script
end
end
How work this script?
This script clone every part who have the same parent of the script, make these part a bit bigger, change the transparency and change the material (You can also change the color) of the new part to make custom materials.
Here is an example (This is some snow bricks)
In this imahe, Some parts use the brick material but transparency of brick parts is 0.75 and these part overlap plastic parts without transparency.
How to use this script?
- First, you must add 4 attributes in your script:
- “Material” (String)
- “Transparency” (Number)
- “Color” (Color3)
- “ChangeColor” (Boolean)
- After, set attributes value.
- Set “Material” attribute to the material you want overlap.
- Set “Transparency” to the transparency of the material of the new part.
- Set “Color” to the color of the new material. (Only if “ChangeColor” = true)
- If “ChangeColor” = true, the new part
Disclaimer: This script may don’t work correctly on Unions or non-CSG parts.
I got difficulties to explain. If you didn’t understood, you need some details or you have any feedbacks, please answer me.
