Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:26 PM |
Hi,
Been looking at some annonymous functions and after a bit of studying I came out with this:
script.Parent.Touched:connect(function(part) part.CanCollide = false end)
(When you touch brick -- Parent of the script -- your body part becomes "CanCollide = false").
Would this work? Also why are they called "Annonymous Functions"? Might sound nooby, but I'm learning.
I admit this "script" might be a bit of a fail.... Please correct if it is:)
Thanks, |
|
|
| Report Abuse |
|
|
SDuke524
|
  |
| Joined: 29 Jul 2008 |
| Total Posts: 6267 |
|
|
| 28 Oct 2011 07:29 PM |
That would set the CanCollide property of whatever brick touches it to false.
They're called anonymous because they have no name. Realize that functions are only variables so doing
function name() print("hi"); end
is similar to doing
name="hi";
which means that doing
print("hi");
or
print(1);
is similar to doing
script.Parent.Touched:connect(function(part) part.CanCollide = false end)
|
|
|
| Report Abuse |
|
|
Jezbob
|
  |
| Joined: 19 Nov 2008 |
| Total Posts: 764 |
|
|
| 28 Oct 2011 07:33 PM |
| Thanks:) Making my way through DingDong272's tutorials... Sometimes answears can be so obivous but I just don't get them:( |
|
|
| Report Abuse |
|
|