Loading UI/Fading UI not working

Basically, the UI I’m working with is not only a Loading UI; the game I’m working on is just a UI, nothing else, which means I can’t make it delete the UI. However, I can also not make it delete the Loading Icon, as it will show up again later.

I was trying to make it so 5 seconds after the player joins the game (The player limit is one), the Loading Icon fades in. However, for some reason, it doesn’t fade in; this is the script I used:

ReplicatedFirst = game:GetService("ReplicatedFirst")
TweenService = game:GetService("TweenService")
local PlayerGui = game.Players.LocalPlayer:WaitForChild("PlayerGui")
local UI = PlayerGui.applicationUI
local popups = UI:WaitForChild("popups")
local loadingIcon = popups:WaitForChild("loadingIcon")
local loadingIconStop = TweenInfo.new(
	2,
	Enum.EasingStyle.Sine,
	Enum.EasingDirection.Out,
	0, 
	false,
	0
)
local stopLoading = TweenService:Create(loadingIcon, loadingIconStop, {ImageTransparency = 1})

ReplicatedFirst:RemoveDefaultLoadingScreen()

wait(5)
stopLoading:Play()
wait(2)
loadingIcon.Spinner.Disabled = true

Help would be appreciated.

3 Likes

Hello There, I’m taking a look at this right now . What exactly is Spinner? I assume it is a local script?

2 Likes

Spinner is a regular script which makes the Loading Icon spin; I disabled it at the end to prevent lag.

2 Likes

To confirm you have a regular script (NOT a local script) set within a starterGui element? Meaning it is replicated to PlayerGUI once the player loads? I’m not saying that’s the issue I simply want to make sure I have every part correct when I diagnose

1 Like

Uh, I don’t really know what you mean, but, it is a Loading Icon for when the player joins. However, the whole game is a UI, it is an Application Center.

2 Likes

He means is the script a normal script or a LocalScript. You should probably learn the difference between those 2 first

1 Like

What is pop ups? A folder or a GUI or a Frame?

1 Like

popups is an invisible frame. Inside it there is the Loading Icon and I will add more things to it soon; it is basically a place where I put the popups, for example, a notification.

2 Likes

Yeah, I know about that, I didn’t understand their question.

1 Like

I missed a comma. My apologies. I was asking
To confirm , (meaning please confirm the following statement I am making) the script named Spinner is a Regular ”Script”, and not a ”LocalScript”

2 Likes

Yes, it is a Regular Script, not a Local Script.

2 Likes

Alright thank you. Just another moment.

2 Likes

I think for tween service it should be a local script. Also, have you tried this plugin:? TweenSequence Editor

2 Likes

I’ll try this plugin; thanks for recommending me it.

1 Like

Is the main script not a localscript as well?

2 Likes

The main script (applicationLoader, which is inside the UI) is not a Local Script, it is a Regular Script.

1 Like

No problem! Just don’t try changing the ui corner radius just yet. Scripts don’t effect it

2 Likes

I thought of making a Remote Event so when that event fires the server, it would tween (I would use another script for when the Remote Event fires the server). I don’t know if that would make it work, though.

1 Like

That’s your issue. You are trying to get LocalPlayer from a Regular Script. LocalPlayer does not replicate across the client server boundary

2 Likes

So, will it work if I change it to a Local Script?

2 Likes