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

Why isnt this dialog teleport script working?

Asked by
EpicLilC 150
9 years ago

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

Log in to vote
1
Answered by 9 years ago

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)
0
^ It didn't work. I wasn't teleported to 1,1,1 and all I got were two scripts. EpicLilC 150 — 9y
0
Did you get an error message? NullSenseStudio 342 — 9y
0
Nope. Just two scripts with one named TimeoutScript and one named ReenableDialogScript EpicLilC 150 — 9y
0
You're using MoveTo wrong. You need to give the MoveTo method a Vector3 argument, but you're giving it 3 number arguments. Spongocardo 1991 — 9y
View all comments (2 more)
0
Ah, foolish me overlooked that. Will edit. NullSenseStudio 342 — 9y
0
And lastly, the event parameters are switched. NullSenseStudio 342 — 9y
Ad

Answer this question