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!
✓ ANSWER ACCEPTED
How to teleport between places?
1 answer
✓ Accepted answer
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

12 comments
Is there an exception in the output? Can you also please post your code in a code block?
What do you mean "exception in the output"? Also, how do you make a code block? I'm new here sorry :(
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?
Hey I think you can just put the place's ID at TeleportService:Teleport(placeID_1)
Cuz this is a localscript, so it can already recognize the player
select the text then click the code block button
I’m using just a script, not a local script, but I can try to use a local script
Also, the place I’m teleporting is inside the game
You are actually testing it outside of studio right? For obvious reasons teleporting within studio won't work.
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".
I got it working. Finally :D! Thanks so much for helping me out!
Good, I put the actual answer up, just mark it as accepted so others can see it too