in the local script you can detect when the player selects the dialogue choice like this:
local dialogobject = --path to the dialog object
local killchoice = --path to the dialog choice which kills player
dialogobject.DialogChoiceSelected:Connect(function(choice)
if choice == killchoice then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end
end)
seems to be on to something but it still isnt working here is what i tried
local dialogobject = script.Parent
local killchoice = dialogobject.DialogChoice.yes.DialogChoice.Death
dialogobject.DialogChoiceSelected:Connect(function(choice)
if choice == killchoice then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end
end)