"MouseButton1Click is not a valid member of DonationFrame"

Hello, so I’m trying to make a donation GUI that verifies your purchase, and I was trying to make the visible option “true” after the player clicked the Donate button, and I kept running into this error:

image

I’m new to making click-to-make-visible GUIs, so I need help with this.

My current code:

local Donate = script.Parent.DonationFrame

Donate.MouseButton1Click:Connect(function()
	print"Yay, it worked!"
	script.Parent.DonationFrame.Visible = true
end)

A Frame doesn’t have a MouseButton1Click event :sweat_smile: You must be thinking of a TextButton instead:

Just change your DonationFrame object to a TextButton then you should be all set :wink:

Ohh, I made a mistake. Thanks!

1 Like