How do you Teleport a Player from Game to Game? I would like to know and understand a Script that allows you to click a Button which would Teleport you from the Game you are currently in to a different game.
Because Dawn did not explain his script and Finick did not do it for when you click a button, or explain his script. Here.
1 | local ts = game:GetService( 'TeleportService' ) -- Get the Teleport Service |
2 | local placeid = 123 -- Replace with your PlaceId |
3 |
4 | function clicked(playerWhoClicked) -- Handle being clicked |
5 | ts:Teleport(placeid,playerWhoClicked) -- Teleport the player |
6 | end -- End the function |
7 |
8 | script.Parent.ClickDetector.MouseClick:connect(clicked) -- Run the Function once clicked |
Problem Il make the script but this is not a request site.
1 | function teleport(placeid, player) |
2 | game:GetService( 'TeleportService' ):Teleport(placeid,player) |
3 | end |
1 | function onTouched(hit) |
2 | local player = game.Players:GetPlayerFromCharacter(hit.Parent) |
3 | if player then |
4 | game:GetService( "TeleportService" ):TeleportToSpawnByName(( 281925931 ), "(SpawnLocation)" , player) |
5 | end |
6 | end |
7 |
8 | script.Parent.Touched:connect(onTouched) |