of     1   

StormAtlas
#139929950Friday, July 11, 2014 12:22 AM GMT

So I was reading the "Absolute beginner's guide to scripting" on the ROBLOX wiki and one section is really confusing. Below is the excerpt I'm talking about from the wiki: "Event Listeners Now we're getting into the meat of scripting. Sure, the script knows where the brick is, but that's all. It can't do anything else. Now we're jumping into a listening event. An event listener watches what's going on, and waits for an event to happen. When it does, it tells the script to do something. This is one important part of the script, otherwise you couldn't really make scripts wait for anything. You still should have the script with the variable in it. We're going to make the script listen for being touched (the Touched event). Here's an example: brick.Touched:connect(onTouch) When the brick is touched, it will execute the function named onTouch. Keep in mind that the name inside the parentheses is the name of the function. This is not the only listener type. There are many more to use, some of which require some familiarity with scripting. Here is a very well-done reference page set up by MrDoomBringer. This is where you can find more help in the future, when you begin to understand scripting more. Not only does it show Events, but also shows other scripting references need for other aspects of scripting." What does "connect" mean/refer to in the line of code that was given? And more importantly, do I have to write "connect" every time I want an event to happen?
blockoo
#139930328Friday, July 11, 2014 12:26 AM GMT

"connect" basically links an event to a function (it connects them, hence the name "connect"). Think of "connect" like a command; you're telling the script to execute the function you give when that event happens.
luigi01302
#139931600Friday, July 11, 2014 12:38 AM GMT

When using functions, you have to call them back later on for them to work right? But they have to happen when an event occurs. brick.Touched:connect(onTouch) -- Let's look at this here. "brick" is the object. "Touched" is the event that triggers the function. "connect:(onTouch)" is the connection between the event and the function shown. The function here is being called back as well. For the last question, yes, if you want an event to trigger a function: you need to use the connect:() method.
StormAtlas
#139933093Friday, July 11, 2014 12:52 AM GMT

@luigi, block Thanks

    of     1