So I tried making a game with dialogs, and I wanted to make it after 5 minutes, you'll die. Here's the script that I used.

local dialog = game.Workspace.Map.Overworld["Security Guard"].Head.Dialog

local function onSelected(player, choice)
	if choice == dialog.TalkChoice.WaitDeathChoice then wait(300)
		game.Players.LocalPlayer.Character.Humanoid.Health = 0
	end
end

dialog.DialogChoiceSelected:Connect(onSelected)

If you have any ideas on how you can fix it as it is not working, please let me know.

2 comments

0

Does it not kill the player? Does it give any errors in f9 console?

0

Try calling this through a remotefunction, that's serversided instead of localscript and should fix the issue.