I'm just trying to make a button that does something when you click it. the problem is it keeps displaying a error saying "MouseButton1Click is not a valid member of Button" All of this code is inside of a local script which is located in the button.
local Player = game.Players.LocalPlayer local Button = script.Parent
Button.MouseButton1Click:Connect(function() print("works") end)

3 comments
are you sure its an ImageButton and not an ImageLabel?
check if ur have typo or not
Its a Text Button