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 » Game Design
Home Search
 

Re: Fire remover script?

Previous Thread :: Next Thread 
Carbon882 is not online. Carbon882
Joined: 10 Jan 2013
Total Posts: 664
01 Nov 2015 06:40 PM
So me my friend play Mini Building Domination and we insert unit sets. A lot of them are infected with fire and it lags the game badly. Is there any script out there what would remove fire from the sets as we insert it?
Report Abuse
USArockssoccer15 is not online. USArockssoccer15
Joined: 28 Jun 2010
Total Posts: 9719
01 Nov 2015 06:43 PM
Maybe you should find a set that isn't infected.
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
01 Nov 2015 07:08 PM
Sometimes you find viruses in the model library. What you need is recursion.

for i,v in pairs(game.Workspace:GetChildren()) do
v:FindFirstChild("Fire"):Destroy()
for ii,vv in pairs(game.Workspace:GetChildren()) do
vv:FindFirstChild("Fire"):Destroy()
for iii, vvv in pairs(game.Workspace:GetChildren()) do
vvv:FindFirstChild("Fire"):Destroy()
end
end
end

Basically, this loops through (for index, value in pairs loops through the table that GetChildren() returns) different hierarchical levels of your workspace (that's where the game.Workspace:GetChildren() comes from) and attempts to find the first child of the v returned named fire (FindFirstChild("Fire")) and we keep adding onto the initial loop by adding more loops inside of that loop. The initial loop scans the first level of children inside workspace, the second loop scans the children of those children, and the third loop scans the children of those children.
So keep adding more loops depending on how far you need to look for fire. This might've been unclear unless you have knowledge of tables but I hope you understood the directions. So..good luck. Next time you have a problem like this, post in the Scripters subforum for faster help.
Report Abuse
Carbon882 is not online. Carbon882
Joined: 10 Jan 2013
Total Posts: 664
11 Nov 2015 12:46 AM
Thanks man!
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
11 Nov 2015 05:33 AM
np
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • 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