Answered by
7 years ago Edited 7 years ago
A function is a chunk of code that you encase that will only run when called on.
for instace
2 | function printSomeLines() |
The code in this function will only run if the function is called upon like so
Alot of events in this game allow you to connect a function to it when they trigger like
2 | button.ClickDetector.MouseClick:Connect(printSomeLines) |
However, you dont have to create your own function and call it, you can make an anonymous function and put it in the event like so
1 | button.ClickDetector.MouseClick:Connect( function () |