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

How do I make an NPC that changes its face when a dialog choice is selected?

Asked by 6 years ago
Edited 6 years ago

I want my NPC to change faces according to which dialog choice a player selects. I started this script, but it does nothing. I don't know what's wrong. Help?

npcface = game.Workspace.WearyTraveler.Christopher.Head.face

game.Workspace.WearyTraveler.Christopher.Head.DialogChoiceSelected:connect(function(player,choice)
    if choice.Name == "DialogOne" then
        npcface.Transparency = 1
    end
end)

(Also, if there's a way to "disable" the face without making it transparent, that'd be great ;) )

1 answer

Log in to vote
0
Answered by 6 years ago

Another thing, I've been putting the script inside of the Dialog, does that mess up anything?

Could I put multiple faces in the Head and set the Transparency on each on to 0? Then, with the script...

joyface = game.Workspace.WearyTraveler.Christopher.Head.joyface --Transparency is 1
sadface = game.Workspace.WearyTraveler.Christopher.Head.sadface --Transparency is 1
chris = game.Workspace.WearyTraveler.Christopher

chris.Head.DialogChoiceSelected:connect(function(player,choice)
    if choice.Name == "DialogOne" then
        joyface.Transparency = 0
    if choice.Name == "DialogTwo" then
    joyface.Transparency = 1
        sadface.Transparency = 0
    end
end) --Do I have enough ends?

And so on

I know this script is crude, but I'm a novice scripter, and it's all I can understand. xD

Ad

Answer this question