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

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

Asked by
s9i 2
3 years ago

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?

0
Plz maek my anseer as correct plas if it works AlexanderYar 788 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

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

Ad

Answer this question