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
 

Is there anything worng with this?

Previous Thread :: Next Thread 
RockTheMIC is not online. RockTheMIC
Joined: 22 Jul 2011
Total Posts: 2319
19 Jul 2012 11:56 AM
What it does is when the brick this script is in is touched by something called "Bodypart" both bricks joints are broken.

function OnTouched(hit)
if hit.Parent.Name == "Bodypart" then
hit:BreakJoints()
part.Touched:connect(OnTouched)
Report Abuse
ghostleader is not online. ghostleader
Joined: 16 Feb 2008
Total Posts: 1131
19 Jul 2012 11:59 AM
function OnTouched(hit)
if hit.Name == "Bodypart" then
hit:BreakJoints()
end
part.Touched:connect(function(hit) OnTouched(hit) end)
Report Abuse
tyridge77 is not online. tyridge77
Joined: 21 Dec 2009
Total Posts: 179
19 Jul 2012 12:02 PM
Actually, you don't need to connect an anonymous function to this.
You could just code
function OnTouched(hit)
if hit.Name == "Bodypart" then
hit:BreakJoints()
end
end
part.Touched:connect(OnTouched)
Report Abuse
BobbyisLOLZ is not online. BobbyisLOLZ
Joined: 17 Aug 2010
Total Posts: 8045
19 Jul 2012 12:03 PM
function OnTouched(hit)
if hit.Name == "Bodypart" then
hit:BreakJoints()
end - You need 2 ends to end the function, and if statement
end
part.Touched:connect(OnTouched) - Idk if it should be hit.Touched:connect(onTouched)
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