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: I'm having trouble!

Previous Thread :: Next Thread 
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:24 PM
So my friend has an infection problem.
Every brick has something named fire in it. So I'm trying to write something out that deletes it

local children = Workspace:GetChildren()
for i = 1, #children do
if children[i].ClassName="Brick" then
children.Fire:Destroy()
end
end

What's wrong with this script though?
And also how would I get it so it runs when the server starts?
Report Abuse
canada1232111 is not online. canada1232111
Joined: 16 Jan 2013
Total Posts: 863
07 Sep 2013 10:26 PM
Or maybe you should tell him to stop using free-models and wasting your time?
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:27 PM
Look, kid.

Free models are free, if he wants to use them he can.
I'm trying to help someone out.
So stop acting so cool because you have 700 posts.

This is scripting helpers. If you're not here to help but just to post, then get out.
Report Abuse
canada1232111 is not online. canada1232111
Joined: 16 Jan 2013
Total Posts: 863
07 Sep 2013 10:29 PM
._. Welp

fien


local children = Workspace:GetChildren()
for i, v in pairs(children) do
if v.ClassName="Brick" then
v.Fire:Destroy()
end
end


That should work,
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 10:30 PM
PM'ed it to you, due to roblox blocking it
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:30 PM
local children = Workspace:GetChildren()
for i, v in pairs(children) do
if v.ClassName="Part" then
v.Fire:Destroy()
end
end

Thanks. I also forgot the class name is Part not Brick.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:31 PM
@SoQuick,

No you didn't..

Also, how do I get it so it runs when a server is started?
Report Abuse
canada1232111 is not online. canada1232111
Joined: 16 Jan 2013
Total Posts: 863
07 Sep 2013 10:31 PM
Oh yeah, I forgot to remove that from mines ._. derp.
Report Abuse
canada1232111 is not online. canada1232111
Joined: 16 Jan 2013
Total Posts: 863
07 Sep 2013 10:32 PM
@TheShoeBox, it should already do that automatically.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:33 PM
Alrighty tighty.

Thanks! He'll be glad I got it to him.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:38 PM
local children = Workspace:GetChildren()
for i, v in pairs(children) do
if v.ClassName="Part" then
v.Fire:Destroy()
v.Guest_Talking_Script:Destroy()
end
end

He said he put it in command bar and it didn't work.

Any other suggestions?
Report Abuse
Soquick is not online. Soquick
Joined: 01 Nov 2012
Total Posts: 1497
07 Sep 2013 10:39 PM
I PM'ed you one, it should work.
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:39 PM
local children = Workspace:GetChildren()
for i, v in pairs(children) do
if v.ClassName=="Part" then
v.Fire:Destroy()
v.Guest_Talking_Script:Destroy()
end
end

Nvm, solved it. Need a double equals sign xD
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:40 PM
I didn't get one btw @Quick
Report Abuse
chaoticregandpledge is not online. chaoticregandpledge
Joined: 04 Dec 2009
Total Posts: 2894
07 Sep 2013 10:44 PM
Seriously, if he's going to use free models, he should have to deal with the consequences of using them. Regardless of this, here's a script to help out your friend. Tell him to be more cautious next time.

recurse = function(dir)
for i, v in pairs(dir:GetChildren()) do
if v.Name == "Fire" then
v:Destroy()
elseif v.Name ~= "Fire" and #v:GetChildren() > 0 then
recurse(v)
end
end
end

recurse(Workspace)
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:46 PM
Wait... It seems to not work if Fire/Guest_Talking_Script isn't in the brick.

How would I check if it's in the brick?
Would this work?

local children = Workspace:GetChildren()
for i, v in pairs(children) do
if v.ClassName=="Part" then
if v.Fire~=nil then
v.Fire:Destroy()
end
if v.Guest_Talking_Script~=nil then
v.Guest_Talking_Script:Destroy()
end
end
end
Report Abuse
TheShoeBox is not online. TheShoeBox
Joined: 20 Aug 2010
Total Posts: 5022
07 Sep 2013 10:49 PM
Thankyouuu.

And also I just have a bit of empathy for him since I used FMs once too.

Report Abuse
godphantom555 is not online. godphantom555
Joined: 12 Mar 2011
Total Posts: 360
07 Sep 2013 10:58 PM
function fix(parent)
    if (#parent:GetChildren()>0) then
    for _,v in pairs(parent:GetChildren()) do
        if (v:IsA("Fire") or v.Name=="Guest_Talking_Script") then
            v:Destroy()
        end
        fix(v)
        end
    end
end
fix(game.Workspace)
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