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

Changing face expression of NPC, but running into "not a valid member" error--what could be problem?

I have an NPC with two different face decals. I want to switch from one face to another by making the first face, regface, transparent and making the second face, sadface, visible.

	game.Workspace.NPCS.Man.Head.regface.Transparency = 1
	game.Workspace.NPCS.Man.Head.regface = Color3.fromRGB(0,0,0)
	game.Workspace.NPCS.Man.Head.sadface.Transparency = 1
	game.Workspace.NPCS.Man.Head.sadface = Color3.fromRGB(255,255,255)

I think the issue happens whenever I try to change the Color3 property, because I can see the transparency of the face changes (for some reason, solely changing the transparency still makes the face visible--lowering the Color3 to (0,0,0) is the only way to make it completely transparent). I get the error that regface is not a valid member of game.Workspace.NPCS.Man.Head, even though it definitely is. What could be the problem here?

1 comment

0

Plz maek my anseer as correct plas if it works

1 answer

I hate to say it but are you paying attention to what you you type? Your not even setting the color

game.Workspace.NPCS.Man.Head.sadface = Color3.fromRGB(255,255,255)

Doesn't change the colour,

game.Workspace.NPCS.Man.Head.sadface.Color = Color3.fromRGB(255,255,255)

This does. If it's not Color then it's Color3 I think, I don't remember the decal colour attribute name.

Hope this helps :3

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