Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
2

Whats the difference between mousebutton1Click and .Activate?

Asked by 4 years ago

Hello, im working with gui buttons and was wondering

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

pls respond. thanks

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. Spjureeedd 385 — 4y

4 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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.

0
No, still not correct Spjureeedd 385 — 4y
0
And I edited my answer, thanks for telling me. matiss112233 258 — 4y
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 Spjureeedd 385 — 4y
Ad
Log in to vote
1
Answered by 4 years ago
Edited 4 years ago

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

Log in to vote
0
Answered by
JesseSong 3916 Moderation Voter Community Moderator
4 years ago

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

0
No, I always use Activated for my guis Spjureeedd 385 — 4y
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. JesseSong 3916 — 2y
Log in to vote
-1
Answered by
99Of19 -10
4 years ago

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

0
That's even worse than my answer above (as a beginner) JesseSong 3916 — 2y

Answer this question