Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 2 years ago

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

1 answer

Log in to vote
0
Answered by 2 years ago

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)
Ad

Answer this question