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: Unweld Blocks On Touch?

Previous Thread :: Next Thread 
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
06 Jan 2014 07:49 AM
Hi, im making a crash disaster game, and I need a script that will unweld certain parts when they are touched by another certain block. If its possible to detect if it has a weld, that would be great! I'll be waiting!!! ;D
Report Abuse
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
06 Jan 2014 07:53 AM
for _, v in pairs(model:GetChildren()) do
if v.ClassName == "Weld" then
v:Destroy()
elseif v.ClassName == "Part" then
for _, s in pairs(v:GetChildren()) do
if s.ClassName == "Weld" then
s:Destroy()
end
end
elseif v.ClassName == "Model" then
for _, z in pairs(v:GetChildren()) do
if z.ClassName == "Weld" then
z:Destroy()
elseif z.ClassName == "Part" then
for _, c in pairs(z:GetChildren()) do
if c.ClassName == "Weld" then
c:Destroy()
end
end
end
end
end
end

--I could go on for forever but eh. model at the top is da model you want to unweld. Or
you can simply do model:BreakJoints() --Derp
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
06 Jan 2014 08:03 AM
I guess I'll use model:BreakJoints, considering the model I want to have unweld everything has a ton of parts... Just wondering, how would I use model:BreakJoints?
Report Abuse
yoshimaster240102 is not online. yoshimaster240102
Joined: 14 Apr 2012
Total Posts: 470
06 Jan 2014 08:04 AM
You find the model and just do model:BreakJoints() or if your lazy: model:BreakJoints''
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
06 Jan 2014 08:07 AM
Could I do:

--Script starts here
game.Workspace.ModelName:BreakJoints()
--Script ends here

???
Report Abuse
funnymouse7 is not online. funnymouse7
Joined: 17 Mar 2011
Total Posts: 1741
06 Jan 2014 08:23 AM
ye

just make sure its not anchored
Report Abuse
TheMcInc is online. TheMcInc
Joined: 30 Sep 2012
Total Posts: 227
06 Jan 2014 08:59 AM
kk thx
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