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: Is there a plugin that anchors all bricks?

Previous Thread :: Next Thread 
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
16 Nov 2012 07:44 PM
That would be handy...even if you had bricks you didn't want anchored, it would be faster to unanchor the ones you didn't want anchored than anchoring every single one.
Report Abuse
TehChikenHater is not online. TehChikenHater
Joined: 11 Jun 2012
Total Posts: 497
16 Nov 2012 07:46 PM
function anchor(obj)
for _,n in pairs(obj:GetChildren()) do
if n:IsA("BasePart") then
n.Anchored=true
elseif n:IsA("Model") then
anchor(n)
end
end
end
Report Abuse
SumoComputerMan is not online. SumoComputerMan
Joined: 20 Apr 2011
Total Posts: 3143
16 Nov 2012 07:48 PM
that's a script
anyways, it could easily be turned into a plugin :P
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
16 Nov 2012 08:03 PM
I can make one for you right quick, one moment. I'll throw one together.

- thumper10, C# Lover
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
16 Nov 2012 08:04 PM
Create a plugin yourself. Don't copy off others. But I guess I'm bored, so I'll post this plugin script.


local plugin = PluginManager():CreatePlugin()
local toolbar = plugin:CreateToolbar("Base Plugin")
local button = toolbar:CreateButton(
"", -- The text next to the icon. Leave this blank if the icon is sufficient.
"Anchor", -- hover text
"" -- The icon file's name. Make sure you change it to your own icon file's name!
)

button.Click:connect(function()
for i, v in pairs(game.Workspace:GetChildren()) do
if v.ClassName = "Part" then
v.Anchored = true
end
end
end)

print("All Bricks Anchored")
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
16 Nov 2012 08:06 PM
Look at this website to get a little bit more info.

http://wiki.roblox.com/index.php/How_To_Make_Plugins
Report Abuse
Jonah13249 is not online. Jonah13249
Joined: 09 Oct 2009
Total Posts: 2105
16 Nov 2012 08:08 PM
Oh yeah, by the way, I made a mistake. Put an extra equal sign on the for statement. So it looks like this:

if v.ClassName == "Part" then

and not this:

if v.ClassName = "Part" then
Report Abuse
thumper10 is not online. thumper10
Joined: 17 Apr 2009
Total Posts: 3304
16 Nov 2012 08:14 PM
Here you go, I just whipped this up:

-- create the plugin
local this = PluginManager():CreatePlugin()
local toolbar = this:CreateToolbar()
local button = toolbar:CreateButton(
    "",
    "Anchor All Bricks",
    "fakeico.png"
)

-- anchor function
function anchor(dir)
    for a, b in pairs(dir:GetChildren()) do
        anchor(b)
    end
    if (b:IsA("BasePart")) then
        b.Anchored = true
    end
end

-- plugin button click handler
button.Click:connect(function()
    anchor(game:GetService("Workspace"))
    button:SetActive(false)
end)
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