Hey guys! Actually made a script for my game which kills the player if the dialog choice but it seems to have an error Here's it by the way
local dialog = script.Parent--Or whatever the path is
dialog.DialogChoiceSelected:connect(function(player, choice) --This is getting the service when the choice is selected
if choice == script.Parent.Else.Else1.Else2.Else3.SkyColor.A.Else4.OwnerName.C.Fail8 then
game.Players.LocalPlayer.Character.Humanoid.Health = 0
end
end)
I had thoughts that its because the DialogChoice has two variables = UserDialog and ResponseDialog, but even if I am true, I have no ideas how to fix the script.
The script itself is located in the Dialog, not in any of the DialogChoices. Thank you scripters!
UPD.: Rewriting the script to LocalScript didn't help me.

2 comments
It's probably because LocalScripts don't run in workspace. Instead, you change it back to normal script, but this time RunContext should be set to Client.
Also change line 5 to @Puppy_lovertheawsome's answer