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

Why is the click event not firing?

sendButton.MouseButton1Click:connect(function()
	print'clicked'
	NewM(script.Parent.Parent.Parent.Parent, messageBox.Text)
	messageBox.Text = 'Message'
end)

"clicked" is never printed, NewM is a valid function, and the message box's text is not changed. I haven't scripted in a while so I'm not sure about the MouseButton1Click event or anything.

1 answer

✓ Accepted answer

Sorry to say, but you messed up an event. MouseButton1Click is not a real event. Please consider this code to replace the above :)

sendButton.MouseButton1Down:connect(function ()
	print 'clicked'
	NewM(script.Parent.Parent.Parent.Parent, messageBox.Text)
	messageBox.Text = 'Message'
end)

2 comments

0

Ah. I think I was using the click detector event.

0

Well, actually, the 'MouseButton1Click' event is on the WIKI, and is a real event. :P And, Golden, 'MouseClick' is the event for a 'Click Detector' type instance, 'MouseButton1Click' fires when you click on a GUI type instance [TextButton, ImageButton].

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