How to fix attempted to teleport to a place that is restricted error message?

I changed the script to LocalScript and placed it into Workspace, it does not do anything, it made the regular message: A game developer has shut down the server. Is there any other way to fix this?

Thanks for the reply btw!

LocalScripts don’t run in workspace

1 Like

Where is it should be? Thx for the reply btw!

LocalScripts can only run if it’s a descendant of a player’s PlayerGui, a player’s Backpack, a player’s PlayerScripts, player’s Character model, or the ReplicatedFirst Service.

2 Likes

Oh yeah. I have forgotten. Silly me. Thanks for the reply!

1 Like

I placed it into StarterPack, still, the same message as normal, The game's developer has temporarily shut down the game server. Please try again. Any other ways?

StarterPack? I remember LocalScripts not running there. Maybe put it in StarterGui or PlayerScripts?

Done it on StarterGui and PlayerScripts. The result are still the same.

Maybe use a server script for BindToClose and use a remoteEvent to show all the guis??

Something like this:

Server Script:

game:BindToClose(function()
    insertRemoteEvent:FireAllClients()
    wait(2)
    for i, player in pairs(game.Players:GetPlayers()) do
        TeleportService:Teleport(place_Id, player)
    end
end)

Client Script:

insertRemoteEvent.OnClientEvent:Connect(function()
    local gui = -- gui here
    gui.Visible = true
end)

I hope this works…

Still doesn’t work. I’m not sure if I’m not doing right, but this is the script I placed into ServerScriptService:

game:BindToClose(function()
RemoteEvent:FireAllClients()
wait(2)
for i, player in pairs(game.Players:GetPlayers()) do
    TeleportService:Teleport(5029093005, player)
end
end

I placed a RemoteEvent into ReplicatedStorage. Honestly, I don’t want the GUI because I have the GUI showed up at the teleported place. And sorry, I am new to scripting.

Umm… did you forget to put a ) at the end of the bindToClose function?

When I placed the ) to the end, it shows red lines: Screenshot by Lightshot

Oh, I forgot…

local RemoteEvent = game.ReplicatedStorage.RemoteEvent
local TeleportService = game:GetService("TeleportService")

Sorry I forgot to tell you that…

The error changed to: Attempted to teleport to a place that is restricted. Any solutions?

That, I honestly don’t know.

You do know the Add Place thing, right?

I think that you can Add the Place you want them to teleport there.

I used Add place thing in this. I can teleport before (2 week ago) but now it can’t…

To detect when a teleport fails, use the event: TeleportService.TeleportInitFailed.

Example:

TeleportService.TeleportInitFailed:Connect(function(player, TeleportResult, errorMessage)
   print("Teleport failed. Error Message: "..errorMessage)
end)

For more info, go to:

Developer Hub

https://gyazo.com/3a2ffb15fedb6caeca248f9493ddef79

There’s a similar topic to yours: Incident Report: Large Spike in Teleport Failures: "Attempted to teleport to a place that is restricted" - #59 by Ice7 This is most likely a Roblox issue.

1 Like

I think so. [[[30 characters]]]