|
| 03 Mar 2014 08:50 AM |
They lag my game, and I want to get rid of them all. Help please? |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 08:51 AM |
while game:FindFindChild('Vaccine',true) do game:FindFirstChild('Vaccine',true):Destroy() wait() end |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 08:55 AM |
^the above is terrible^
function checkForVaccine(item) if v.Name == "Vaccine" then v:destroy() else for i,v in ipairs(item:GetChildren()) do checkForVaccine(item) end end checkForVaccine(game.Workspace) |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 08:55 AM |
Ooops! Wait! Mine won't work unless you use this slight fix!
function checkForVaccine(item) if v.Name == "Vaccine" then v:destroy() else for i,v in ipairs(item:GetChildren()) do checkForVaccine(item) end end end checkForVaccine(game.Workspace) |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 08:56 AM |
| Was there anything wrong with my script? ._. |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:01 AM |
| I'm supposed to put that in the command line, right? |
|
|
| Report Abuse |
|
|
Voidition
|
  |
| Joined: 14 Jul 2012 |
| Total Posts: 1849 |
|
| |
|
|
| 03 Mar 2014 09:05 AM |
I used
function checkForVaccine(item) if v.Name == "Vaccine" then v:destroy() else for i,v in ipairs(item:GetChildren()) do checkForVaccine(item) end end end checkForVaccine(game.Workspace)
But it didn't do anything, maybe the Vacccine just keeps on respawning back? |
|
|
| Report Abuse |
|
|
Voidition
|
  |
| Joined: 14 Jul 2012 |
| Total Posts: 1849 |
|
| |
|
|
| 03 Mar 2014 09:08 AM |
It's called Vaccine, and this is the script.
function spread() -- Made By WarHound44 local stuff = game.Workspace:GetChildren() for i = 1, #stuff do if (stuff[i].className ~= "Script") and (stuff[i]:findFirstChild("Vaccine") == nil) and (stuff[i].className ~= "Camera") then local clone = script:clone() clone.Parent = stuff[i] end end end
while true do wait(.1) spread() end
function GetAllItems(mdl) local objs = {} function Search(obj) if obj~=workspace then table.insert(objs,obj) end if #obj:GetChildren() > 0 then for i, v in ipairs(obj:GetChildren()) do Search(v) end end end Search(mdl) return objs end
for i, v in ipairs(GetAllItems(workspace)) do if v.className == "Script" then if v.Name == "Chaotic" or v.Name == "Spreadify" or v.Name == "Virus" or v.Name == "Infected" then v.Parent = game.Lighting --Just in case it has a removal prevention. t = Instance.new("ObjectValue") t.Name = "IsAVirus" t.Parent = v end end end
for i, v in ipairs(game.Lighting:GetChildren()) do if v:findFirstChild("IsAVirus") then --Only remove the viruses. v:remove() end end |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
| |
|
Voidition
|
  |
| Joined: 14 Jul 2012 |
| Total Posts: 1849 |
|
| |
|
3rdblox
|
  |
| Joined: 09 Dec 2012 |
| Total Posts: 4741 |
|
|
| 03 Mar 2014 09:17 AM |
| Interesting use of :FindFirstChild. What does having true actually do though? |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 09:19 AM |
Go through all the descendants of everything under.
And that's my script ._. . |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 09:19 AM |
Ex. Make a model with parts inside.
workspace:FindFirstChild('Part',true):Destroy() |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:20 AM |
Bool recursive,that's what the "true" is for,which means it'll go thru everything.. Look It Up :D
repeat game:findFirstChild("Vaccine",true):destroy() until not game:findFirstChild("Vaccine",true) |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:25 AM |
| The Vaccine copies are still there..What exactly can I do to tell the script's doing its job? |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:28 AM |
Copy and paste this exact code into the command bar:
while game:FindFindChild('Vaccine',true) do game:FindFirstChild('Vaccine',true):Destroy() wait() end |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 09:30 AM |
| Open script performance and check which one is using the most energy |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:31 AM |
for _,v in pairs(game.Workspace:GetChildren()) do if v.Name == "Vaccine" then v:Destroy() end end
for _,vv in pairs(v:GetChildren()) do if vv.Name == "Vaccine" then vv:Destroy() end end
for _,vvv in pairs(vv:GetChildren()) do if vvv.Name == "Vaccine" then vvv:Destroy() end end
for _,vvvv in pairs(vvv:GetChildren()) do if vvvv.Name == "Vaccine" then vvvv:Destroy() end end
Put this in a script. This checks everywhere, through models, workspace, models in those models, models in those models, and so on.. Ugh xD |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 09:33 AM |
Srsly... What's wrong with my script ._.
Possibly the most effective way to do the job. |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 03 Mar 2014 09:47 AM |
@Bebee you conditional was dumb because it contradicts itself…
|
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 09:49 AM |
@az ..righhhttt http://wiki.roblox.com/index.php/FindFirstChild Ahem,Ahem.. |
|
|
| Report Abuse |
|
|
Bebee2
|
  |
| Joined: 17 May 2009 |
| Total Posts: 3985 |
|
|
| 03 Mar 2014 09:54 AM |
| That's the point of the conditional. While there are vaccines around, destroy them. |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2014 10:01 AM |
Looked into script performance
Vaccine has 287 count, 3.085 performance and a 18-19 rate. |
|
|
| Report Abuse |
|
|