Hello! I have been wondering for awhile now, what is the difference between the way these two functions are written, and why or why not is one used at certain times?
game.Workspace.somethingHappened:Connect(function()
--bla bla bla bla bla
end)
function somethingHappened()
--bla bla bla bla bla
end
game.Workspace.somethingHappened:Connect(somethingHappened)
There is no difference in use except for the fact you can use the second one to establish multiple event connections to a single function instead of a single event connection to a single function.
Nope there’s no significant difference in performance as far as I know and it’s all about preference. I use the first always unless I need the 2nd for multiple connection events.