So I'm making a game, and inside it after you are done talking to someone (with dialog) 5 seconds after talking it will teleport them to a different game. Could anyone try to give me a script for it?
Tested this out and it will work! This script should go into ServerScriptService
or Workspace
.
local guy = game.Workspace:WaitForChild("Person Name") --Works with humanoids with the name. local dialog = guy:WaitForChild("Head"):WaitForChild("Dialog") local id = --Place ID dialog.DialogChoiceSelected:connect(function (player,selection) wait(1) if selection.Name == "Dialog Name" then --This checks for if the player clicks the DialogChoice named "Dialog Name" game:GetService("TeleportService"):Teleport(id) dialog.Parent = nil else --Other Dialog that is not that option. (optional) end end)