Hello, im working with gui buttons and was wondering
what is the difference between
button.MouseButton1Click
and
button.Activated
pls respond. thanks
Hello, im working with gui buttons and was wondering
what is the difference between
button.MouseButton1Click
and
button.Activated
pls respond. thanks
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.
No, still not correct
And I edited my answer, thanks for telling me.
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:
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
No, I always use Activated for my guis
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
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.
1 comment
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.