So, this is my Loading GUI script, the teleport works properly, but the GUI is on the screen for less than a second, when I intend it to be on the screen for ten seconds, and the music doesn't play. To try to see what was causing the problem, I added some print outputs into the script. When I looked at the log after teleporting again, none of the print outputs were shown in the log.

LocalScript in ReplicatedFirst at the destination

game:GetService("TeleportService").LocalPlayerArrivedFromTeleport:connect(function(customLoadingScreen, data)
	spawn(function() 
		-- Spawn a function to set the top bar transparency as soon as the PlayerGui is created
		local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
		PlayerGui:SetTopbarTransparency(0) 
		print("nerd stuff")
	end)
	print("sound coming")
	local sound = Instance.new("Sound")
	sound.Parent = game.Players.LocalPlayer.PlayerGui
	sound.SoundId = "rbxassetid://863447854"
	sound:Play()
	print("about to wait")
	wait(10) -- Wait until we want to remove the custom loading screen
	print("done waiting")
	customLoadingScreen:Destroy()
	sound:Stop()
	print("destroying gui")
end)

The script that initiates the teleportation at the start place. This is just a fragment of the script. I'm defining the clickSound variable and randomizing the math tick at the top. If I need to do something with the TeleportService at the very top of the script, I'm not doing it.

script.Parent.MouseButton1Down:connect(function()
	clickSound:Play()
	local decal = math.random(1,3)
	print(decal)

	if decal == 1 then
		decal = "rbxassetid://863193274"
	elseif decal == 2 then
		decal = "rbxassetid://863193509"
	elseif decal == 3 then
		decal = "rbxassetid://863193661"
	end

	local loadGui = game.ReplicatedStorage.LoadingGUI:Clone()
	loadGui.Frame.Image.Image = decal
	local player = game.Players.LocalPlayer	

	script.Parent.Parent.credits.LocalScript:Destroy()
	game:GetService("TeleportService"):Teleport(863170336, player, {}, loadGui)
	script:Destroy()
end)

Now, here's the funny part. The scripts run PERFECTLY in Studio play mode, but when I actually join the game is when it doesn't work properly. I've had two of my friends join the game as well, and they get the same problem.

4 comments

0

What does the local script print?

0

Nothing. "When I looked at the log after teleporting again, none of the print outputs were shown in the log."

0

In game did you look at the client log and the server log? Also is FE on?

0

Found it. Error in the Client Log, I was just viewing the Server.