Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why does it throw the error 'not a valid member'?

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?

1 answer

✓ Accepted answer

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.

1 comment

0

This fixed all of my ReplicatedFirst scripts xD Thanks

This discussion is preserved as it was. New answers, comments, and votes are closed.