I’ve been making a plugin for the last few hours that lets you use tools to quickly create parts, save part settings, insert a player’s avatar and more.
When I got to the material part, I obviously have a whole bunch of buttons. I was wondering if anyone could tell me how I’d go about changing the material without using a million elseif statements. Obviously Enum.Material.VariableName wouldn’t work, and it’s 12 AM right now so my brain is working at 5% efficiency.
I’ve tried looking for problems similar on the devforum but came up short.
Here’s the list of materials I have:
I don’t think the code is necessary, but if you need some of the code I wrote I can supply!
Gahhh! Thank you so much!
My brain is barely functioning right now and I can’t think at all. If I wasn’t so determined to finish this tonight I prob would’ve done that.
You’re a literal life saver! I’m so sleep deprived
iirc you can utilize Enum.Materials:GetEnumItems(), what this method does is just return an array of the enums, and since you are using them you can just use a for loop and iterate through the Enums and get all the info you need from them