So i'm trying to figure out how to teleport a player when they select a specific choice for the dialog. What's wrong with this script, and how do I fix this? (I also put the script under dialog for the record).
Dialog=script.Parent Dialog.DialogChoiceSelected:connect(function(Choice, Player) if Choice == Dialog.DialogChoice1.DialogChoice2.DialogChoice3 then Player.Character:MoveTo(1,1,1) end end)
Another thing to add is that two scripts pop up and then remove themselves when i'm using this script.
The error is because you are missing an end
. Also, there is no MoveTo
method on a Player
object, what you need to use MoveTo
on is that player's Character
.
Dialog=script.Parent Dialog.DialogChoiceSelected:connect(function(Player, Choice) if Choice == Dialog.DialogChoice3 then Player.Character:MoveTo(Vector3.new(1,1,1)) end end)