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

"Frame" is not a valid member of ScreenGui. Please Help me with my Error?

script.Parent.MouseButton1Click:Connect(function() script.Parent.Parent.Frame = false end)

1 answer

You're going to want to use Locals. Is the script inside of the button? Put the script into the ScreenGUI, define the button and frame and ensure that it is localized correctly.

local button = script.Parent.TextButton
local frame = script.Parent.Frame

function Click()
	frame:Destroy()
end
 
button.MouseButton1Click:Connect(Click)

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