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

MouseButton1Click is not a valid member of Button?

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

0

are you sure its an ImageButton and not an ImageLabel?

0

check if ur have typo or not

0

Its a Text Button

1 answer

✓ Accepted answer

uuh, don't make button a variable, do that

script.Parent.MouseButton1Click:Connect(function()
	print("this button works!")
end)

this script should be work

5 comments

0

if you need other thing tell me

0

still doesnt work and displays an error saying "MouseButton1Click is not a valid member of TextBox "Players.General_ChaosTv.PlayerGui.MainGui.SettingsMenu.MusicButton

0

TextBox? Did you use a TextBox instead of a TextButton?

0

Also, use Activated instead of MouseButton1Click if you want your script to work on all platforms.

0

Yep your right it is a textbox. Sry if I waited your time because I'm new at scripting.

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