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

Whats the difference between mousebutton1Click and .Activate?

Hello, im working with gui buttons and was wondering

what is the difference between button.MouseButton1Click and button.Activated

pls respond. thanks

1 comment

1

Activated is an event that fires when the button is pressed or clicked on any platform. If you use MouseButton1Click it will only work for those who use a mouse. Not for those on mobile or tablet etc.

4 answers

✓ Accepted answer

To clarify on what @VortexGamingPlayerYT said,

Button.Activated is for when any platform activates the button, so if you are on mobile, and you tap it, it will still work. Button.MouseButton1Click is just used for MouseButton1 clicks, or left mouse button clicks.

3 comments

0

No, still not correct

0

And I edited my answer, thanks for telling me.

0

Really? Your answer was very wrong. I'm not mad because you stole what I wrote, if I would have wanted the rep so bad I wouldn't have posted it as a comment. But don't answer if you don't know for sure

Just to clear up this misconception, MouseButton1Click and Activated both work on all devices. I know the name MouseButton1Click can be misleading, but how do I know it works on phone/tablet? Simple, I joined my own game on mobile and tapped on a GUI. Even with MouseButton1Click in the script of the GUI, it worked perfectly fine.

MouseButton1Click and Activated have only one difference that I know of. It's that Activated allows inputObject as a parameter. So you can use Activated for whenever you want to do something with user input (which is very helpful).

Good question and I hope this helps!

(Edit: I know you've got different answers right now to your question. I will provide some links that might help:

GuiButton.MouseButton1Click

GuiButton.Activated

Other people talking about this exact same topic

Click the following links on Activated and MouseButton1Click

The difference between the 2 functions : MouseButton1Click and .Activated is that mousebutton1click fires an event once a player has clicked a gui. But .Activated is .Activated is for tools once a player has clicked a tool then an event will fire .Activated is only used for tools while mousebutton 1click is only used for GUIs

2 comments

0

No, I always use Activated for my guis

0

Yea, i was a beginner then, so obviously i wouldn't really have known about this information then. I might edit this answer in the future.

Click1ButtonMouseFunction is used whenever a player enters the game, it calls a PlayerAdded event. Activate however instances a part in workspace

1 comment

0

That's even worse than my answer above (as a beginner)

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