Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to properly teleport? No errors but it does not work.

Asked by 3 years ago

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

01local ts = game:GetService("TeleportService")
02 
03local btn = script.Parent
04 
05local gameID = 6266940721
06 
07game.Players.PlayerAdded:Connect(function(player)
08    plr = player
09end)
10 
11local function teleporter(gameID, plr)
12    local plr = game.Players:FindFirstChild(plr)
13    print("Teleporting to game")
14    ts:Teleport(plr, gameID)
15end
16 
17btn.Activated:Connect(function()
18    teleporter(gameID, plr)
19end)

All help is appreciated!

0
You swapped the parameters of ts:Teleport(). The placeID comes first, then the player. Also it won't work on studio Dfzoz 489 — 3y
0
You swapped the parameters of ts:Teleport(). The placeID comes first, then the player. Also it won't work on studio Dfzoz 489 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

Maybe you don't have it enabled on the studio settings. Try publishing your game to get access to those settings then navigate to, game settings>Security>Allow third party teleports.Enable it if its disable and test the script again. Hope this helps.

Ad

Answer this question