Local TeleportService = game:GetService("TeleportService") In ReplicatedFirst LocalScript local ReplicatedFirst = game:GetService("ReplicatedFirst") It’s actually recommended to use TeleportService:GetLocalPlayerTeleportData() and TeleportService:GetArrivingTeleportGui() instead of LocalPlayerArrivedFromTeleport (see TeleportService | Roblox Creator Documentation) I realized the real problem I’m trying to solve is keeping a black screen on throughout teleporting, then I can always fade the black screen out and in before and after teleporting respectively. Task.spawn(OnLocalPlayerArrivedFromTeleport, LoadingScreenGui) LoadingScreenGui = Instance.new("ScreenGui") Local LoadingScreenGui = TeleportService:GetArrivingTeleportGui() TeleportService.LocalPlayerArrivedFromTeleport:Connect(OnLocalPlayerArrivedFromTeleport) LocalPlayer.OnTeleport:Connect(OnPlayerTeleport) Local Tween = TweenService:Create(LoadingScreenFrame, TweenInfo.new(5), ) -Fade out tween. Local PlayerGui = LocalPlayer:WaitForChild("PlayerGui") LoadingScreenFrame.Parent = LoadingScreenGui LoadingScreenFrame.Size = UDim2.new(1, 0, 1, 0) LoadingScreenFrame.BackgroundColor3 = Color3.new(0, 0, 0) LoadingScreenFrame.Name = "LoadingScreenFrame" Local LoadingScreenFrame = Instance.new("Frame") LoadingScreenGui.Name = "LoadingScreenGui" Local LoadingScreenGui = Instance.new("ScreenGui") Local Players = Game:GetService("Players") ReplicatedFirst:RemoveDefaultLoadingScreen() Local ReplicatedFirst = Game:GetService("ReplicatedFirst") Local TweenService = Game:GetService("TweenService")
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |