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

Frame does not exist? GUI help.

Basically, I have a ClickDetector in a Part, and when you click on it a GUI appears. After 3 seconds, the Frame's background is supposed to fade out, but Studio is trying to tell me a Frame doesn't exist, but it clearly does as a Child of the GUI. Here's my script, am I missing something? Because I have no idea. Everything works up to line 9.

This is the error I get: Frame is not a valid member of ScreenGui. Thank you if you can help.

local blurdialogue = game.Lighting.WindowBlurGUI1
script.Parent.ClickDetector.MouseClick:connect(function(plr)
	print("This window is too blurry to be seen through")
	local blurclone = blurdialogue:Clone()
	blurclone.Parent = plr.PlayerGui
	wait(3) 
	for i = 0, 1, .5 do
		blurclone.Frame.Transparency = i
		wait()
		blurclone:Destroy()
	end 
end)

1 answer

✓ Accepted answer

You include in your loop that you want to get rid of burclone. This will remove all of its children, causing the error.

The solution is to :Destroy() the gui after the loop, not in the middle of fading it out.

1 comment

0

Oh wow, didn't even think of that. Works perfectly, thank you so much!

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