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

How to teleport between places?

Asked by 4 years ago

I'm trying to teleport between places, but my script isn't working. The script is: local TeleportService = game:GetService("TeleportService") local placeID_1 = my place id local function onPartTouch(otherPart) local player = game.Players:GetPlayerFromCharacter(otherPart.Parent) if player then TeleportService:Teleport(placeID_1, player) end end script.Parent.Touched:Connect(onPartTouch). Whenever I try this, nothing happens. Could someone please show me the correct way to do it? Thanks!

0
Is there an exception in the output? Can you also please post your code in a code block? programmerHere 371 — 4y
0
What do you mean "exception in the output"? Also, how do you make a code block? I'm new here sorry :( 525600Rent 0 — 4y
0
The teleport method states this: "You may only teleport players to places within the same game or active start places for other games." Are you sure you are able to teleport to this place? User#834 0 — 4y
0
Hey I think you can just put the place's ID at TeleportService:Teleport(placeID_1) TheRealPotatoChips 793 — 4y
View all comments (8 more)
0
Cuz this is a localscript, so it can already recognize the player TheRealPotatoChips 793 — 4y
0
select the text then click the code block button GreenBushed 13 — 4y
0
I’m using just a script, not a local script, but I can try to use a local script 525600Rent 0 — 4y
0
Also, the place I’m teleporting is inside the game 525600Rent 0 — 4y
0
You are actually testing it outside of studio right? For obvious reasons teleporting within studio won't work. User#834 0 — 4y
0
Yes, he is right. A error will appear in the output will appear. To open the output, go to "View" on the top of the screen then find and click "Output". TheRealPotatoChips 793 — 4y
0
I got it working. Finally :D! Thanks so much for helping me out! 525600Rent 0 — 4y
0
Good, I put the actual answer up, just mark it as accepted so others can see it too User#834 0 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

Just as a sidenote for anyone else who lands on this. Teleportation does NOT work in studio, if you want to test teleportation you must be doing it in a live game. This means publishing your game first and playing it online.

Ad

Answer this question