The following code is a Localsript in ReplicatedFirst.
while wait() do if ContentProvider.RequestQueueSize == 0 then for i = 0, 1, 0.02 do Splashscreen.Background.Logo.ImageTransparency = i wait() end wait(1) for i = 0, 1, 0.02 do Splashscreen.Background.Transparency = i wait() end end Splashscreen:Destroy() -- line 19 end
Why does it throw the error...
14:53:00.748 - Background is not a valid member of ScreenGui
14:53:00.751 - Stack Begin
14:53:00.752 - Script 'ReplicatedFirst.SplashscreenScript', Line 19
14:53:00.752 - Stack End
...even though the Frame Background is a child of the ScreenGui called Splashscreen?
It hasn't replicated yet
The trick with ReplicatedFirst
is that there is absolutely no promise that by the time your script is run there will be anything else. The solution? Just use WaitForChild
or create the Instances using your script.