So I saw a tutorial for loading screen but the problem is that the tween applies as soon as default loading screen removed
game > ReplicatedFirst > LocalScript > (my GUI)
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
wait(5) --Tried to put delay but still ending so fast
local PlayerGUI = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local GUI = script.LoadingScreen:Clone()
GUI.Parent = PlayerGUI
repeat wait() until game:IsLoaded()
if game:IsLoaded() then
local position = UDim2.new(0.5, 0,-1, 0)
GUI.LoadingFrame:TweenPosition(position, Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.35)
end
if not game:IsLoaded() then
game.Loaded:Wait()
end
wait(5)
GUI:Destroy()
I tried to search for solution anywhere but didnât see anything helpful for this problem. I have the same problem as this guy but different script
Your âanimationâ is too fast so you canât see anything.
In your case, this should fix it.
local Players = game:GetService("Players"); --//players service
local ReplicatedFirst = game:GetService("ReplicatedFirst"); --//repfirst service
local TweenService = game:GetService('TweenService'); --//tween service
local Player = Players.LocalPlayer; --// local player
local PlayerGui = Player:WaitForChild'PlayerGui'; --// wait for playergui
local LoadingScreen = script:WaitForChild('LoadingScreen'); --// wait for loading screen
local GUI = LoadingScreen:Clone(); --// clone screen
GUI.Parent = PlayerGui; --// parent cloned screen into local player gui
ReplicatedFirst:RemoveDefaultLoadingScreen(); --// remove def. loading screen
wait(5); --// force screen to appear for some sec.
if not game:IsLoaded() then --// if game didn't load already then
game.Loaded:Wait(); --// wait for game to load
end;
local Info = TweenInfo.new(.35, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut); --// tween info
local Tween = TweenService:Create(GUI.LoadingFrame, Info, {Position = UDim2.new(0.5, 0,-1, 0)}); --// create tween
Tween.Completed:Connect(function()
GUI:Destroy();
end); --// destroy GUI after animation is completed
Tween:Play(); --// play tween
game.ReplicatedFirst:RemoveDefaultLoadingScreen()
wait(5) --Tried to put delay but still ending so fast
local PlayerGUI = game:GetService("Players").LocalPlayer:WaitForChild("PlayerGui")
local GUI = script.LoadingScreen:Clone()
GUI.Parent = PlayerGUI
repeat wait() until game:IsLoaded()
if game:IsLoaded() then
local position = UDim2.new(0.5, 0,-1, 0)
GUI.LoadingFrame:TweenPosition(position, Enum.EasingDirection.InOut, Enum.EasingStyle.Sine, 0.35)
wait(5)
end
if not game:IsLoaded() then
game.Loaded:Wait()
end
wait(5)
GUI:Destroy()
Donât. Thereâs absolutely no reason for anyone to wait for the game to load using the repeat loop, especially that the .Loaded event exists - you should wait for it instead.