Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How would I use teleportservice to have a custom teleport/loading ui?

I am making an indiana jones adventure puzzle but want to make a custom teleport screen. When I run the script their is no error and it teleports fine. The GUI appears on the start place when I teleport but once the player arrives at the second place the GUI is not in the game. I tried everything but I don't know what to do.

this is the script I use to initiate the teleport

function teleport(PlaceID,player)
	local TeleportScreen = Instance.new("ScreenGui",playerGUI)
	TeleportScreen.Name = "TeleportScreen"
	
	local teleportFrame = Instance.new("Frame",TeleportScreen)
	teleportFrame.Name = "TeleportFrame"
	teleportFrame.Size = UDim2.new(1,0,1,0)
	teleportFrame.Position = UDim2.new(0,0,0,0)
	teleportFrame.BackgroundColor3 = Color3.new(0,0,0,0)
	teleportFrame.ZIndex = 1
	teleportFrame.Position = UDim2.new(0,0,1.2,0)
	teleportFrame.Size = UDim2.new(1,0,1.154,0)
	
	local LoadingLabel = Instance.new("TextLabel",teleportFrame)
	LoadingLabel.Name = "LoadingLabel"
	LoadingLabel.Size = UDim2.new(1,0,1,0)
	LoadingLabel.Font = Enum.Font.Bodoni
	LoadingLabel.TextColor3 = Color3.new(255,255,255)
	LoadingLabel.TextScaled = true
	LoadingLabel.BackgroundTransparency = 1
	LoadingLabel.TextTransparency = 0
	LoadingLabel.Position = UDim2.new(0,0,0,0)
	LoadingLabel.Size = UDim2.new(1,0,1,0)
	LoadingLabel.ZIndex = 2
	LoadingLabel.Text = "Preparing The Adventure"

	teleportFrame:TweenPosition(UDim2.new(0,0,-0.154,0))
	
	tpService:Teleport(PlaceID,player,{},TeleportScreen)
end

this is the script on the place the accepts the teleport

local TeleportService = game:GetService('TeleportService')
script.Parent:RemoveDefaultLoadingScreen()

TeleportService.LocalPlayerArrivedFromTeleport:Connect(function(customLoadingScreen, data)
	wait(3)	
	customLoadingScreen.TeleportFrame:TweenPosition(UDim2.new(0,0,-1.154,0))
	wait(2)
	customLoadingScreen:Destroy()
end)

please help! I don't know what to do and made by game development come to a stop.

1 answer

✓ Accepted answer

(Start game) Try having the GUI already made and parented in ReplicatedFirst.

Local Script put in startergui

local tp = game:GetService("TeleportService")
tp:SetTeleportGui(game.ReplicatedFirst.Load) -- Reference the GUI instance.

This discussion is preserved as it was. New answers, comments, and votes are closed.