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

dialog killscript does not kill?

Asked by 6 years ago
Edited 6 years ago
script.Parent.DialogChoiceSelected:Connect(function(Dialog)
    if Dialog.Name == 'talk2' then
        if Dialog.Parent:findFirstChild("Humanoid") then
            Dialog.Parent.Humanoid.Health = 0
        end
    end
end)

there are two dialog choices, one of them being talk2

how does one make the dialog script kill?

edit: due to the new fe implementation into all roblox games, the script is not fe compatible.

0
Try using FindFirstChild() Instead of findFirstChild() MahadTheIronSword 98 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago

This is because the first parameter to DialogChoiceSelected is the player that selected the dialog.

script.Parent.DialogChoiceSelected:Connect(function(Player, Dialog)
    if Dialog.Name == 'talk2' then
        Player.Character.Humanoid.Health = 0
    end
end)

Ad

Answer this question