Teleport Gui Not working

Hi!
I wanna make Teleport Gui (not the custom loading screen)
So I’d like to make when the player clicked tp button, with some text on the textbox, the player gets teleported to a given place, but with a GUI with that text, the player wrote.

RFirst:

local service = game:GetService("TeleportService")
local tp_gui = service:GetArrivingTeleportGui()
if tp_gui then
local playerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
tp_gui.Parent = playerGui
end

ScreenGui:

local service = game:GetService("TeleportService")
local plr = game.Players.LocalPlayer
local gui = game.ReplicatedStorage.ScreenGui
script.Parent.TextButton.MouseButton1Click:Connect(function()
service:SetTeleportGui(gui)
service:Teleport(4339240815, plr)
end)

So when I get teleported after clicking tp, my loading screen deletes, and I don’t get any GUI

1 Like

This thread is far too vague and lacks any kind of detail which is crucial to resolving problems. Please ensure you include details in the future threads, such as if there are any error messages in the Developer Console or details from research you’ve done into the problem.

First I’d like to highlight a pet peeve that your code has raised for me: your variable naming is pretty poor (service for TeleportService is unclear) and you have inconsistencies regarding how you fetch services (some use GetService, some don’t).

For the ScreenGui you currently have, the only noticeable issue is the lack of WaitForChild on a child of ReplicatedStorage. Instances aren’t implicitly available to the client as they must be replicated from the server to the client, so make sure you include that. You should also make sure that the ScreenGui properly shows up with a quick drag to StarterGui in Studio (it should be Enabled and all).

Beyond that, there’s no immediate issues with your code. Make sure that the code running GetArrivingTeleportGui is in the place you’re teleporting to and the ScreenGui is in another; don’t put them in the same place.