Restricted Place Issue

Hello fellow devs,

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.

Script: local player = game.Players.LocalPlayer

script.Parent.MouseButton1Click:Connect(function()
wait(32)
game:GetService(‘TeleportService’):Teleport(10683967550, game.Players.LocalPlayer)
end)

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

1 Like

I have updated the game but it says this “Your uncommitted script changes have not been published” But there is no uncommitted scripts.

1 Like

Roblox 8_25_2022 11_21_19 AM

2 Likes

You need to use GetCharacterFromPlayer or you just have to publish both places(doesn’t mean that they have to be public)

1 Like

But like how would I even do that?

local telePart = script.Parent

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

end

wait(32)
Connect(otherGame)

I had this issue a while ago but it turns out I had just mistyped the place id so check that too

The last line Connect(otherGame) is invaild.

I could make it work but only on touched or clicked, is that ok, or do you need the wait (32)

1 Like

I need the wait 32 but I want it on click

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)

or is it a textbutton that needs to be clicked

A text button that needs to be clicked…

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.

I’m using that because I chose to.

enable teleport to place in
Settings > Security

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)
1 Like

Not my game but my friends this is for. It was public and it never worked.

Still Restricted it says. Not sure what to do anymore…