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

Material Change Not Working?

I wrote this code and only the transparency changes material doesn't. Can you please tell me why it isn't? Or what should I do to make it work?

game.Players.PlayerAdded:connect(function(player)
    if player.Name == "Player1" then
        player.Chatted:connect(function(msg)
	if msg == "Test" then
		game.Workspace.Glass.Transparency = 0
		game.Worksapce.NanosStuff.Glass.Material = 1056
		
	elseif msg == "Test2" then
		game.Workspace.Glass.Transparency = 0.6
		game.Worksapce.Glass.Material = 288
	end
        end)
    end
end)

1 answer

You miss typed Workspace into Worksapce. Mind checking your output next time before posting a question here? Thanks :D

I also suggest to just use Enum.Material.MaterialName instead of their Enumeric Int values, for readability.

2 comments

0

You can also just do: Part.Material = "Grass"

0

True, but that doesn't work on if statements for some reason

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