Why do I get an error when I try teleporting a player with this script?
So I asked a question a few days ago about Teleporting other players to private servers and got an answer that seemed to work. When I was testing the script that made it so it teleports you to the same place as the player was currently in. It worked and then when I tried to make the script teleport you to a different place I got an error with the code 769. I don't know if its the game or the script so please help.
01 | local TS = game:GetService( "TeleportService" ) |
02 | local Players = game:GetService( "Players" ) |
03 | local DSS = game:GetService( "DataStoreService" ) |
04 | local DS = DSS:GetGlobalDataStore() |
05 | local ClickDetector = script.Parent |
08 | local code = DS:GetAsync( "ReservedServer" ) |
09 | if type (code) ~ = "string" then |
10 | code = TS:ReserveServer(game.PlaceId) |
11 | DS:SetAsync( "ReservedServer" ,code) |
14 | ClickDetector.MouseClick:Connect( function (plr) |
15 | TS:TeleportToPrivateServer( 3926134089 ,code, { plr } ) |