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.)
local ts = game:GetService("TeleportService") local btn = script.Parent local gameID = 6266940721 game.Players.PlayerAdded:Connect(function(player) plr = player end) local function teleporter(gameID, plr) local plr = game.Players:FindFirstChild(plr) print("Teleporting to game") ts:Teleport(plr, gameID) end btn.Activated:Connect(function() teleporter(gameID, plr) end)
All help is appreciated!
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.