I am trying to make a script where if the player selects a certain choice, they die. The script doesn’t work, there are no errors and it doesn’t print anything.
Script:
local Dialog = script.Parent
Dialog.DialogChoiceSelected:Connect(function(Player, Choice)
print(Player, Choice)
if Choice.Name == "What are you going to do?" then
Player.Character.Humanoid.Health = 0
end
end)
1 Like
The script should be a local script because DialogChoiceSelected only fires on the client and not on the server. So make it local script and also change the local Dialog
variable to the new path
Thank you! The Dialog page of the DevHub never specified whether I needed a Script or a LocalScript.
You could’ve just clicked on the link at the start where it shows the reference for the DialogChoiceSelected
, but whatever it’s fixed either way