How to properly teleport? No errors but it does not work.
Hello ScriptingHelpers! I have a problem with teleport service, where I finally get no errors, but the teleportation never occurs. Here's the code. (This is in a server script, by the way.)
01 | local ts = game:GetService( "TeleportService" ) |
03 | local btn = script.Parent |
05 | local gameID = 6266940721 |
07 | game.Players.PlayerAdded:Connect( function (player) |
11 | local function teleporter(gameID, plr) |
12 | local plr = game.Players:FindFirstChild(plr) |
13 | print ( "Teleporting to game" ) |
14 | ts:Teleport(plr, gameID) |
17 | btn.Activated:Connect( function () |
18 | teleporter(gameID, plr) |
All help is appreciated!