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

I forgot how Mousebutton1click works?

Asked by 4 years ago

So if i say:

~~~~~~~~~~~~~~~~~

TextButton.Mousebutton1click:connect(function(wdh)
    print("Hello Wald ")      ------- this part right here what does this do? Does it add or what?
end)

~~~~~~~~~~~~~~~~~

0
MouseButton1Click :) Imperialy 149 — 4y

2 answers

Log in to vote
0
Answered by
sheepposu 561 Moderation Voter
4 years ago
Edited 4 years ago

Mouse button click is an event attached to GUI buttons. When the button is pressed, the event is fired and the provided event is executed. In the example you've provided, you start a new function where the function is provided and write the code inside there. I don't believe there are any parameters provided to the function from MouseButton1Click so the "wdh" should not be there. So when the function is executed, it will simply print "Hello Wald " into the output. I hope this helps you understand how MouseButton1Click works. For more info - https://developer.roblox.com/en-us/api-reference/event/GuiButton/MouseButton1Click

Ad
Log in to vote
0
Answered by 4 years ago
Edited by royaltoe 4 years ago

Adding onto sheepposu's answer, the actual function is written as the following:

TextButton.MouseButton1Click:Connect(function()
print("hi")
end)

Answer this question