generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Annonymous Functions - Help?

Previous Thread :: Next Thread 
Jezbob is not online. 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 is not online. 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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image