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

Why won't the script print or show any errors for this Dialog code?

Asked by
2Loos 168
3 years ago

Background: So I'm making a game and when you go up to this npc and talk to him, and select the correct dialogs, it should provide a badge. I'm currently testing some code for this though. This is a LocalScript inside of StarterGui. The code:

local Tags = nil
for i,v in pairs(game.Workspace.LakeStuff:GetChildren()) do
    if v:IsA("Model") then
        Tags = v
    end
end
print(tostring(Tags.Parent.Name))
local dialog = Tags.Head.Dialog
dialog.DialogChoiceSelected:Connect(function(player, choice)
    if choice == dialog.DialogChoice.DialogChoice.DialogChoice.UserDialog then
        print("CorrectChoice")
    end
end)

The part up to print(tostring(Tags.Parent.Name)) works fine. The DialogChoiceSelected won't work though. Any fix to this, or am I even using the function right?

0
Is this deprecated or something 2Loos 168 — 3y
0
(DialogChoiceSelected) 2Loos 168 — 3y

Answer this question