Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Is it true that it's proper to use :Connect instead of :connect while scripting?

Someone told me that I could improve by using :Connect instead of using :connect. Does it matter which one I use? I think it's one of those things that can work both ways.

Example:

script.Parent.MouseButton1Click:Connect(function()

2 comments

1

Use Connect. If ROBLOX says its deprecated then it's best to use the version they support.

0

I use :connect, so I guess I am done.

2 answers

✓ Accepted answer

:connect() is deprecated, meaning that Roblox may remove its functionality at any point (i.e. the code is at risk of breaking). Items are deprecated when they are no longer meant to be used for an assortment of reasons. Some examples are that the original method was a typo or does not look like other property and method names.

It is recommended to use the provided alternative, :Connect(), as this method does not run the risk of breaking your code and will continue to be regularly updated by Roblox.

Absolutely does not matter. Use either one. He probably just thought that because the wiki says that 'connect' is deprecated.

This discussion is preserved as it was. New answers, comments, and votes are closed.