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
 

Touch detecting bricks of the same name

Previous Thread :: Next Thread 
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
30 Nov 2013 11:53 PM
Hey guys,

How would I have an ontouched function with a group of bricks with the same name.

Example: Every special brick is named Killbrick, killbrick's would have a global function detecting an ontouched event.

Thanks!
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
30 Nov 2013 11:54 PM
function touched(part)
if part.Name == script.Parent then
--stuff
end
end
script.Parent.Touched:connect(touched)
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
30 Nov 2013 11:55 PM
I'm talking about one script detecting a group of bricks with the same name.
Report Abuse
Trapper4O77 is not online. Trapper4O77
Joined: 03 Aug 2011
Total Posts: 5648
30 Nov 2013 11:55 PM
Make a for pair loop and add a touched event to each value in the loop. Then have the touched event connect to on function and viola!

"Ladies and gentlemen, take my advice. Pull down your pants and slide on the ice"
Report Abuse
Laedere is online. Laedere
Joined: 17 Jun 2013
Total Posts: 23601
30 Nov 2013 11:55 PM
i don't really know what you mean
Report Abuse
VanillaLight is not online. VanillaLight
Joined: 02 Nov 2013
Total Posts: 834
30 Nov 2013 11:56 PM
Thanks, I appreciate it.

-Vanilla
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