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

Part's Material not changing in script?

Well this might sound obviously stupid, but I just want to feel accomplished for making a game, and this the only issue I have

I just have this little game where a part is generated into workspace. I have gui buttons that change all parts that are generated, as well the ones already in workspace. The main problem is that it won't change the new bricks generated.

Here's the simple brick generation

Settings = script.Material_Settings

-- These are values which determine the part's material when the value is true

Plastic = Settings.Plastic
Neon = Settings.Neon
Wood = Settings.WoodPlanks
Brick = Settings.Brick
---------------------------------------------------------------------------------------------------------------
while wait(.1) do
	Brick = Instance.new('Part',workspace)
	if Plastic == true then
		Brick.Material = 'Plastic'
	elseif Neon == true then
		Brick.Material = 'Neon'
	elseif Wood == true then
		Brick.Material = 'WoodPlanks'
	elseif Brick == true then
		Brick.Material = 'Brick'
	end
end

If anything else is needed, just let me know

1 answer

Use Enum.Material.Grass and replace grass with what material you want. SIMPLE! Example

game.Workspace.Part.Material = Enum.Material.Grass

3 comments

0

accept awnswer if this helps!

0

This isn't the solution to my problem but thanks

0

YES IT IS DID U LOOK AT EXAMPLE??? Add enum.Material after the equal sign!

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