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: how do i make this script unanchore a model

Previous Thread :: Next Thread 
toasterr is not online. toasterr
Joined: 14 Feb 2011
Total Posts: 36
18 Dec 2012 08:20 PM
how do i make this weld script unanchore a model right before adding welds?

script:

function Weld(x,y)
local W = Instance.new("Weld")
W.Part0 = x
W.Part1 = y
local CJ = CFrame.new(x.Position)
local C0 = x.CFrame:inverse()*CJ
local C1 = y.CFrame:inverse()*CJ
W.C0 = C0
W.C1 = C1
W.Parent = x
end

function Get(A)
if (A.className == "Part") or (A.className == "Part") then
Weld(script.Parent.Engine, A)
else
local C = A:GetChildren()
for i=1, #C do
Get(C[i])
end
end
end

function Finale()
Get(script.Parent)
end

Finale()
Report Abuse
xXTheRobotXx is not online. xXTheRobotXx
Joined: 05 May 2012
Total Posts: 13343
18 Dec 2012 08:24 PM
for i,v in pairs(model) do
if v:IsA("Part") then
v.Anchored = true

Error 407:["Siggy.exe not found."] Please try again in a few moments.
Report Abuse
toasterr is not online. toasterr
Joined: 14 Feb 2011
Total Posts: 36
18 Dec 2012 08:27 PM
thanks but were do i put that part?
Report Abuse
toasterr is not online. toasterr
Joined: 14 Feb 2011
Total Posts: 36
18 Dec 2012 08:36 PM
it didnt work D:
Report Abuse
doombringer42 is not online. doombringer42
Joined: 13 Nov 2007
Total Posts: 5445
18 Dec 2012 08:43 PM
you have to use recursive searching.

function recurse(o)
for _, v in pairs(o:GetChildren()) do recurse(o) end
o.Anchored = true
end

¬ LuaLearners Elite/Teacher(+3) ♣ SHG Scripter Tier-2
Report Abuse
Lordswordbane is not online. Lordswordbane
Joined: 30 Nov 2012
Total Posts: 11
18 Dec 2012 08:44 PM
function recurse(o)
for _, v in pairs(o:GetChildren()) do recurse(o) end
o.Anchored = true
end
Report Abuse
toasterr is not online. toasterr
Joined: 14 Feb 2011
Total Posts: 36
18 Dec 2012 08:47 PM
thanks but were do i put that part of the script also will it unanchore the moldel? because the model is anchored and has to be unanchored
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