Custom Teleport GUI not popping up

I’m trying to get a custom GUI to load when teleporting to another place however it only pops up before teleporting, and then the regular roblox loading screen shows up.

I’m trying to teleport from place 1 to place 2

Place 1 script:

local TeleportService = game:GetService("TeleportService")

local teleportGui = game:GetService("ReplicatedStorage").TeleportGui
TeleportService:SetTeleportGui(teleportGui)

function onTouched(Hit)
    local Player = game.Players:GetPlayerFromCharacter(Hit.Parent)
	if Player then
		TeleportService:Teleport(10320169906,Player)
		teleportGui.Parent = Player.PlayerGui
		print("Test")
	else
		warn("Error")
    end
end
 
script.Parent.Touched:connect(onTouched)

Place 2 local script:

local TeleportService = game:GetService("TeleportService")

local Players = game:GetService("Players")

local ReplicatedFirst = game:GetService("ReplicatedFirst")

local customLoadingScreen = TeleportService:GetArrivingTeleportGui()

if customLoadingScreen then

local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")

ReplicatedFirst:RemoveDefaultLoadingScreen()

customLoadingScreen.Parent = playerGui

-- add something here for the gui

wait(5)

-- gui ends/gets destoryed

customLoadingScreen:Destroy()

end

I’m getting these errors in place 2:
image
I’m guessing that means the GUI didn’t go through so I tried removing teleportGui.Parent = Player.PlayerGui from the place 1 script but that didn’t change anything. Does anyone know how this can be fixed?

When you use :GetPlayerFromCharacter in the script from Place 1, you use “Character.Parent”, which isn’t the character.

Replace that line with:

local Player = game.Players:GetPlayerFromCharacter(Character)

I tried this but it makes the script do nothing. I think it stopped the script from getting the player

How he has it correct, Character.Parent is the Character, that should be renamed to something like hit or limb, as without the .Parent it is just the limb that touched it.

I opened the place with the script Valiant suggested
Mars - Roblox

if you guys can help me figure out why the GUI wont appear
that would be great

Edit: edited the character to hit so its more understandable. closed the place

Capitalize Connect in script 1.

:connect will always work even if its lower cased

Are you trying to set a custom place loading screen?

https://developer.roblox.com/en-us/api-reference/function/TeleportService/Teleport

I think you could use the 4th argument in :Teleport() to make it work

I never really used this service but this is all I remember from what I learned

1 Like

The second place already uses the local script for GetArrivingTeleportGui()
I don’t think I can apply it to Teleport()

@Superr_Z … Has your problem been resolved yet ?

I am trying myself to find a Smooth Transition ‘Viewing’ from 1 Place to another Place, without the user noticing the Game/Experience closing the current Place & opening the New one that they Teleported to.

Thanks in advance

Unfortunately, no. I went through a bunch of posts about this topic but all I found was that the service might be too slow to load the GUI. I’m convinced I did something wrong as other games can teleport players flawlessly but idk what.

1 Like

I’m not sure if this will help… as it’s what I’m looking at
But I’m still wrapping my head around scripting… but will get there
Still busy doing Terrain & Modelling places.

Hope you can find success with this :

I just hope the change-over isn’t as long as the demo video
Let me know