I have made a game where if you click a button it teleports the players but the issue with this is, is that the teleport says its a restricted place though it isn’t as the game is public. I’m not sure really what to do and different things on this matter but nothing seems to be working.
The script is not the problem, just an hour ago, i saw a post with same problem.
Their problem was that they did not publish the game after making changes to the settings.
So try alt+p
local TeleportService = game:GetService(‘TeleportService’)
local placeID = 5020048423
local canTeleport = true
local function otherGame(otherPart)
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player and canTeleport then
canTeleport = false
TeleportService:Teleport(placeID, player)
end
local telePart = script.Parent
local TeleportService = game:GetService(‘TeleportService’)
local placeID = 0000000000
local canTeleport = true
local function otherGame(otherPart)
local player = game.Players:FindFirstChild(otherPart.Parent.Name)
if player and canTeleport then
canTeleport = false
TeleportService:Teleport(placeID, player)
end
end
telePart.ClickDetector.MouseClick:Connect(function(hit)
task.wait(32)
telePart.ClickDetector.MouseClick:Connect(otherGame)
end)
Why are you using :Teleport? You should really be using TeleportAsync as stated in the docs. I don’t think that should cause this issue but I thought I would just say.
Issue is the game you are trying to teleport to is not public (or at least not sure if you got the wrong ID cuz the place that I got from the ID you put in is not public).
I created some code which I tested which would teleport you to a plublic game and it works fine for me until I put the ID you have in your code so I guess that is the issue:
local Button = script.Parent.TextButton
local Plr = game.Players.LocalPlayer
local TP = game:GetService("TeleportService")
Button.MouseButton1Click:Connect(function()
TP:Teleport(10688509762, Plr)
end)