Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

2 comments

0

thanks

0

No problem, I haven't tested it at all so let me know how it goes once you've tried it.

This discussion is preserved as it was. New answers, comments, and votes are closed.