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

Can you help me fix this problem with an if statement with a certain material?

I'm trying to make an NPC that can walk through parts, but not parts that are Diamond Plate.

if game.Workspace.moof.seeed.Material == "DiamondPlate"
then
--I don't have to put the then part because It's not the problem.

2 comments

0

Yeah should work... is seed supposed to have three es?

0

Should work... Just check to make sure the names are correct, just in case.

1 answer

The issue is that the Material property is not a string, it is an Enum.

The reason this is hard to spot, is ROBLOX allows you to quickly assign Enum values with strings, however whenever checking them you cannot use this shortcut. if game.Workspace.moof.seeed.Material == Enum.Material.DiamondPlate then

1 comment

0

^ What the..Who talks like that.

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