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:
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?
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 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.
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.
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