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

How to teleport between places?

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!

12 comments

0

Is there an exception in the output? Can you also please post your code in a code block?

0

What do you mean "exception in the output"? Also, how do you make a code block? I'm new here sorry :(

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?

0

Hey I think you can just put the place's ID at TeleportService:Teleport(placeID_1)

0

Cuz this is a localscript, so it can already recognize the player

0

select the text then click the code block button

0

I’m using just a script, not a local script, but I can try to use a local script

0

Also, the place I’m teleporting is inside the game

0

You are actually testing it outside of studio right? For obvious reasons teleporting within studio won't work.

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".

0

I got it working. Finally :D! Thanks so much for helping me out!

0

Good, I put the actual answer up, just mark it as accepted so others can see it too

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.