I'm trying to make it so when you choose the wrong choice of dialog, it kills you. I'm sorta new to scripting. Please tell me what's wrong in this script.
function clicked(player, dialogChoice)
print("Ran it")
print(player)
print(dialogChoice)
if dialogChoice.Name == "Kill" then
print("player wants killed")
game.Workspace:FindFirstChild(player.Name).Humanoid.Health = 0
else
print(dialogChoice)
end
end
script.Parent.DialogChoiceSelected:connect(clicked)

4 comments
on line 7 try player.Character.Humanoid.Health = 0 . is it in a local script or server script?
It's a server script. Should it be a local script?
Well it depends. Local scripts are for things only the client see, and server scripts are for the server. If that doesn't work on line 7, then I'm not sure how to fix it. also you get the humanoid by getting the player.Character.Humanoid.
It didn't work but thank you anyway :)