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

Error with this script, I am trying to change a part to different a material?

local part - game.Workspace.Baseplate

wait(30)
part.Material = *Material*.New("Neon")

There is a blue squiggly line under the * material * in line 4. What should I replace it with?

1 comment

0

why is there a - instead of =

2 answers

✓ Accepted answer

What you did wrong.

There isn't a way to make a new material for starts and you also referenced the change of material wrong. As programmerHere stated, it isn't a variable. It's an Enum. To understand Enum, click me!. This should have multiple things to look into to help you later on.

What you should look into.

Alright so you should look more into how to change properties in a script for ROBLOX. I'll leave you a search tab for material. I'll also leave a link to AlvinBlox, a Youtuber who makes ROBLOX Scripting Tutorials.

Fixed Script.

local part - game.Workspace.Baseplate

wait(30)
part.Material = Enum.Material.Neon

Let me know if there's any issues.

3 comments

0

Thanks, I'll try it out.

1

Thanks for the help, I accepted your answer!

0

No problem!

Material is not a built-in variable.

BasePart.Material is an enum, and to get a Material enum you write Enum.Material.MaterialName.

So change to part.Material = Enum.Material.Neon.

In the autocomplete you will see a list of materials you can use. Some are for terrain, so only use the ones that you can use on regular parts in the explorer.

1 comment

0

Thanks for your answer, I accepted another answer but thanks anyways.

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