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
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Anchor all parts

Previous Thread :: Next Thread 
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:15 PM
I tried this

local prev = nil
parts = script.Parent:GetChildren()




for i = 1, #parts do
    if parts[i]:isA("BasePart") then
        if prev ~= nil then
            local weld = Instance.new("Weld")
            weld.Part0 = parts[i]
            weld.Part1 = prev
            weld.C0 = parts[i].CFrame:inverse()
            weld.C1 = prev.CFrame:inverse()
            weld.Name = tostring(parts[i]) .. " is attached to " .. tostring(prev)
            weld.Parent = prev
        end
        prev = parts[i]
    end
end



But nothing happend and I got no output.
:ccccccccccccccc


~= Welds stink.=~
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:16 PM
your not saying what prev is xD
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:16 PM
what is it welding?
Report Abuse
352ynnhoj is not online. 352ynnhoj
Joined: 21 Sep 2010
Total Posts: 1054
22 Dec 2011 06:17 PM
also your just saying if nil is not nil then...
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:17 PM
OOPs wrong script. :CCCC




parts = game.Workspace:GetChildren()

for i = 1, #parts do print("Line 3")
    if parts[i]:IsA("BasePart") then print("Line 4")
        parts.Anchored = true print("Line 5")
        wait(1)
        parts.Anchored = false print("Line 7")
    end print("Line 8")
end print("Line 9")

print("Line 11")

~= Welds stink.=~
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:18 PM
parts = game.Workspace:GetChildren()

for i = 1, #parts do
print("Line 3")
if parts[i]:IsA("BasePart") then
print("Line 4")
parts.Anchored = true
print("Line 5")
wait(1)
parts.Anchored = false
print("Line 7")
end
print("Line 8")
end
print("Line 9")

print("Line 11")


silly, the prints were wrong xD
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:18 PM
@352

And that was a weld script that worked LOL.


~= Welds stink.=~
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:19 PM
@bob
Your a fool that also didn't work and you can have


function hi() print("LOLO")


And I said no output so if the "prints were wrong" then it would error.

~= Welds stink.=~
Report Abuse
Penguine236 is not online. Penguine236
Joined: 13 Apr 2011
Total Posts: 1303
22 Dec 2011 06:20 PM
@poke

also in that weld script, there is no need to have the variable prev. Idk why its there.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:21 PM
prev is the previous part if that wasn't there then it would weld it's self to it's self.

~= Welds stink.=~
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:22 PM
pokemon, shut up, im only trying to help, noob.
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:23 PM
mr i can only get 915 place visits cuz i can't build or script.
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:25 PM
If you can't build or script then DON'T POST.


~= Welds stink.=~
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:27 PM
why did you just post then? and if i can't build or script how come i have over 55k place visits? i think people think im a good builder by that, and over 4k faves, >.<
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:28 PM
You JUST said you couldn't build or script idiot.

~= Welds ROCK.=~
Report Abuse
Erganion is not online. Erganion
Joined: 29 Apr 2011
Total Posts: 14
22 Dec 2011 06:30 PM
parts = game.Workspace:GetChildren()
for i = 1, #parts do
if parts[i]:IsA("BasePart") then
parts[i].Anchored = true --Forgot the [i] here
wait(1)
parts[i].Anchored = false --And here, you just had parts.Anchored
end
end
Report Abuse
bob354293 is not online. bob354293
Joined: 26 Oct 2008
Total Posts: 2609
22 Dec 2011 06:36 PM
dude, i never said i can't build or script, get a job :3
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:39 PM
"mr i can only get 915 place visits cuz i can't build or script."

Read now.

~= Welds ROCK.=~
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:40 PM
@Erga

Nothing happend. :c

~= Welds ROCK.=~
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:42 PM
Whoops it worked but how to I make it do that all a once?

~= Welds ROCK.=~
Report Abuse
pokemon771 is not online. pokemon771
Joined: 28 Oct 2008
Total Posts: 8671
22 Dec 2011 06:51 PM
Nvm I got it.

~= Welds ROCK.=~
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