I think I see the issue. I noticed that when teleporting, you are changing the visibility property of a frame to Visible. However I believe the properties reset to how they were without scripts while being teleported.
I suggest you would make a new ScreenGui instead, put this one in ReplicatedStorage.
As you have a fade tween, I recommend you change your frame’s transparency to 0 and Visibility to true.
In the teleport script, quickly change the transparency to 1, and then bring the TeleportGui into the PlayerGui. Now you are safe to make the fade in effect.
Now in the place you are teleporting to, make an identical ScreenGui as your TeleportGui inside of ReplicatedFirst. Use repeat wait until game:IsLoaded()
and then wait about 2 or 3 seconds. Now you can fade out and destroy your UI using another LocalScript.
For better context here are some screenshots of my workspace:
Start Place
Destination Place:
Here is a short script that should fix your issue, keep in mind I used a button for the teleport to make this easier to explain:
The script inside the button I used
script.Parent.MouseButton1Click:Connect(function()
local TweenService = game:GetService("TweenService")
local TeleportService = game:GetService("TeleportService")
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
local playerGui = Players.LocalPlayer:WaitForChild("PlayerGui")
local placeId = 8486213665
local TeleportUI = ReplicatedStorage:FindFirstChild("TeleportGui")
local screentweenInfo = TweenInfo.new(.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local logotweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local logotweenInfoCancel = TweenInfo.new(.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local FadeInBackground = TweenService:Create(TeleportUI.Frame, screentweenInfo, {BackgroundTransparency = 0} )
local FadeOutBackground = TweenService:Create(TeleportUI.Frame, screentweenInfo, {BackgroundTransparency = 1} )
local SizeOutLogo = TweenService:Create(TeleportUI.Frame.Logo, logotweenInfo, {Size=UDim2.new(1,0,1,0)})
local SizeInLogo = TweenService:Create(TeleportUI.Frame.Logo, logotweenInfoCancel, {Size=UDim2.new(0,0,0,0)})
repeat wait() until Players.LocalPlayer
TeleportUI.Frame.Logo.Size = UDim2.new(0,0,0,0)
TeleportUI.Frame.BackgroundTransparency = 1
TeleportUI.Parent = playerGui
FadeInBackground:Play()
FadeInBackground.Completed:Wait()
SizeOutLogo:Play()
SizeOutLogo.Completed:Wait()
TeleportService:SetTeleportGui(TeleportUI)
TeleportService:Teleport(placeId)
end)
The script in the TeleportGui of the destination place
local Players = game:GetService("Players")
local TeleportUI = script.Parent.Parent
TeleportUI.Parent = Players.LocalPlayer.PlayerGui
local TweenService = game:GetService("TweenService")
local screentweenInfo = TweenInfo.new(.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local logotweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local logotweenInfoCancel = TweenInfo.new(.5, Enum.EasingStyle.Sine,Enum.EasingDirection.InOut)
local FadeInBackground = TweenService:Create(TeleportUI.Frame, screentweenInfo, {BackgroundTransparency = 0} )
local FadeOutBackground = TweenService:Create(TeleportUI.Frame, screentweenInfo, {BackgroundTransparency = 1} )
local SizeOutLogo = TweenService:Create(TeleportUI.Frame.Logo, logotweenInfo, {Size=UDim2.new(1,0,1,0)})
local SizeInLogo = TweenService:Create(TeleportUI.Frame.Logo, logotweenInfoCancel, {Size=UDim2.new(0,0,0,0)})
TeleportUI.Frame.Logo.Size = UDim2.new(1,1,1,1)
TeleportUI.Frame.BackgroundTransparency = 0
repeat wait() until game:IsLoaded()
wait(1.5)
SizeOutLogo:Play()
SizeOutLogo.Completed:Wait()
wait(2)
FadeOutBackground:Play()
FadeOutBackground.Completed:Wait()
script.Parent.Parent:Destroy()
A video that shows that it works:
I’m not that great at explaining things, so I hope this is enough to fix your issue. If there are any other problems you may be having, be sure to reply
And something you may want to look into is disabling the CoreGui while teleporting, it will make place teleporting look insanely smooth with a TeleportGui.