Teleporting with a button to a game

Continuing the discussion from Teleporting Help:

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?
    A teleporting system that would function with a correct code. If player would type correct code in textbutton it would teleport him to a random game.

  2. What is the issue? Include screenshots / videos if possible!
    I do not know the issue yet, I have searched the script with the output.

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?

I know that teleporting to another game does not permit studio.
Gui is just Code and play button

1 Like

@vesolje1
Is this on a local script or normal script?

Hi, if this script is on a script it won’t be work because of the LocalPlayer. If this script on a local script then you should change teleport line with

game:GetService("TeleportService"):Teleport(8425229400)

I hope this is going to work.

its local script but i can change it to a normal script if it make it work?

image
It is a local script but something isn’t working tho

The first line says TextBox, but your button is a TextButton, probably that is causing your issue’s.

No, you need to identify the player in the second parameter of :Teleport()
Also, use " instead of ’ to identify strings.
If the script works, there should be a “Cannot teleport in studio” error in your output.

you can use ’ and " it doesn’t matter

yeah its strange lol


it says cannot teleport in studio
but in game it does not work either

do you have the Teleports thing enabled in your game settings?

Well then the script works, make sure you got the right ID in there though.

OHHH LOL, you can’t teleport in the studio. you need to join the game

yeah but it doesnt work in game


does the most part of script