Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why isnt this dialog teleport script working?

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.

1 answer

✓ Accepted answer

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)

6 comments

0

^ It didn't work. I wasn't teleported to 1,1,1 and all I got were two scripts.

0

Did you get an error message?

0

Nope. Just two scripts with one named TimeoutScript and one named ReenableDialogScript

0

You're using MoveTo wrong. You need to give the MoveTo method a Vector3 argument, but you're giving it 3 number arguments.

0

Ah, foolish me overlooked that. Will edit.

0

And lastly, the event parameters are switched.

This discussion is preserved as it was. New answers, comments, and votes are closed.