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: Lava

Previous Thread :: Next Thread 
WALLE112 is not online. WALLE112
Joined: 26 Jul 2008
Total Posts: 712
25 Apr 2012 10:48 PM
Why does this no longer work everytime?

function onTouch(hit)

hit.Parent:BreakJoints()

end

script.Parent.Touched:connect(onTouch)

Only works once.
Report Abuse
MagnificentWhip is not online. MagnificentWhip
Joined: 06 Apr 2012
Total Posts: 195
25 Apr 2012 10:49 PM
wedding crasher
Report Abuse
WALLE112 is not online. WALLE112
Joined: 26 Jul 2008
Total Posts: 712
25 Apr 2012 10:49 PM
Is there a way to make it work more than once?
Report Abuse
Legend26 is not online. Legend26
Joined: 08 Sep 2008
Total Posts: 10586
25 Apr 2012 11:25 PM
There won't_always_necessarily be a parent, so add a check for that.


function onTouch(hit)
if not hit.Parent then return end
hit.Parent:BreakJoints()
end

script.Parent.Touched:connect(onTouch)
Report Abuse
Quenty is not online. Quenty
Joined: 03 Sep 2009
Total Posts: 9316
25 Apr 2012 11:46 PM
I think my code looks prettier:

script.Parent.Touched:connect(function(Hit)
if Hit and Hit.Parent then
Hit.Parent:BreakJoints()
end
end)
Report Abuse
DXPower is not online. DXPower
Joined: 21 Oct 2008
Total Posts: 2866
26 Apr 2012 06:38 AM
Are you wanting the WHOLE model to break?

With a Five-Guys burger in my hands, I am now invincible!
Report Abuse
BunnyBoy26 is not online. BunnyBoy26
Joined: 17 Jun 2010
Total Posts: 5674
26 Apr 2012 07:32 AM
That is bad you could be breaking the joints of the Workspace.
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