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 » Scripters
Home Search
 

Re: Unanchor model?

Previous Thread :: Next Thread 
Patrickblox is not online. Patrickblox
Joined: 13 Jul 2009
Total Posts: 133
28 Dec 2014 04:18 PM
Okay, so I have a model called Cannon, and I want every brick inside it to be unanchored, to which I've used the follow:

for i, v in pairs (game.Workspace.Cannon:GetChildren()) do
v.Anchored = false

Problem is, it unanchores each brick at a time, making it a slow process. I haven't been able to find any help on the internet, which is why I made this post. Thanks in advance.

Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
28 Dec 2014 04:23 PM
Uhm, one brick at a time.. but the interval is like .03 seconds. Stop being greedy for fastnarse dis works fien pls

local model = game.Workspace.Model

function unAnchor(model)
for i,v in pais(model:GetChildren()) do
if v:IsA("BasePart") then
v.Anchored = false
end
if #v:GetChildren() > 0 then
unAnchor(v)
end
end
end

unAnchor(model)
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
28 Dec 2014 04:28 PM
local function property(o, p, v)
pcall(function(o[p] = v end)
for _, object in next, o:GetChildren() do
property(object, p, v)
end
end

property(workspace.Model, "Anchored", false)
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
28 Dec 2014 04:31 PM
I shall nevar post again. 4k milestone.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
28 Dec 2014 04:33 PM
Typo fix

pcall(function(o[p] = v end)

Was meant to be

pcall(function() o[p] = v end)
Report Abuse
Patrickblox is not online. Patrickblox
Joined: 13 Jul 2009
Total Posts: 133
28 Dec 2014 04:36 PM
Well Goulstem, I shortned your script to make it work and thanks. Also, gratz on the milestone.
Report Abuse
128GB is not online. 128GB
Joined: 17 Apr 2014
Total Posts: 8056
28 Dec 2014 04:37 PM
Whats wrong with mine?

Plus mine can be used for more than 1 property


property(workspace, "Name", "Hello world!")

Would rename everything in workspace 'Hello world!'
Report Abuse
Goulstem is not online. Goulstem
Joined: 04 Jul 2012
Total Posts: 7177
28 Dec 2014 04:38 PM
urs looks 2cool
Report Abuse
Patrickblox is not online. Patrickblox
Joined: 13 Jul 2009
Total Posts: 133
28 Dec 2014 04:40 PM
128GB, nothing at all, just tried out the first thing that got posted.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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