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

Material Change Not Working?

Asked by 7 years ago
Edited 7 years ago

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

Log in to vote
1
Answered by
RubenKan 3615 Moderation Voter Administrator Community Moderator
7 years ago
Edited 7 years ago

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.

0
You can also just do: Part.Material = "Grass" QuantumToast 261 — 7y
0
True, but that doesn't work on if statements for some reason RubenKan 3615 — 7y
Ad

Answer this question