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

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

Asked by 4 years ago
Edited 4 years ago
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?

0
why is there a - instead of = TheRealPotatoChips 793 — 4y

2 answers

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

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.

0
Thanks, I'll try it out. HimoutoUmaruDomaChan 20 — 4y
1
Thanks for the help, I accepted your answer! HimoutoUmaruDomaChan 20 — 4y
0
No problem! Just2Terrify 566 — 4y
Ad
Log in to vote
0
Answered by 4 years ago

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.

0
Thanks for your answer, I accepted another answer but thanks anyways. HimoutoUmaruDomaChan 20 — 4y

Answer this question