Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How would I go about making a string of a Material Name?

Asked by 5 years ago

PumpkinPrice = PumpkinPrice * UnnamedValues.ValueArray.MaterialArray[tostring(Object.Material)]

But there are many conflicts, as .Value would print it's enum correspondant, and ^ throws an error.

I want to be able to directly get the name of the material from a base part.

1 answer

Log in to vote
0
Answered by 5 years ago

Here is a function I wrote real quick to more easily return the material value. Hopefully it suits what you're looking for.

function ParseMaterialType(BasePart)
    return string.sub(tostring(BasePart.Material), 15)
end
0
thanks Simulants 52 — 5y
0
No problem, I haven't tested it at all so let me know how it goes once you've tried it. SummerEquinox 643 — 5y
Ad

Answer this question