Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How can I make a script that will wait for 5 minutes then it'll kill the player (using dialog)?

Asked by 2 years ago

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.

0
Does it not kill the player? Does it give any errors in f9 console? KingDomas 153 — 2y
0
Try calling this through a remotefunction, that's serversided instead of localscript and should fix the issue. KingDomas 153 — 2y

Answer this question