|
| 09 May 2014 01:26 PM |
This script works for the virus and 4D spreads that effect your game. I tried it and it worked so if you need a script try this one or kason321 script
http://www.roblox.com/Maximum-Protection-V1-item?id=155838524 |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 09 May 2014 01:28 PM |
The entire script contents:
function killinf(bin) local items = bin:GetChildren() for i = 1, #items do if items[i].Name == "INfecTION" then items[i]:Destroy() else local other = items[i] killinf(other) end end end killinf(workspace) |
|
|
| Report Abuse |
|
|
Seranok
|
  |
| Joined: 12 Dec 2009 |
| Total Posts: 11083 |
|
|
| 09 May 2014 01:40 PM |
local virus = game:FindFirstChild("INfecTION", true) while virus do virus:Destroy() virus = game:FindFirstChild("INfecTION", true) end |
|
|
| Report Abuse |
|
|
stravant
|
  |
 |
| Joined: 22 Oct 2007 |
| Total Posts: 2893 |
|
|
| 09 May 2014 01:50 PM |
@Seranok
That's an interesting approach that I wouldn't have considered. I wonder whether it's faster or slower than the recursive searching approach. |
|
|
| Report Abuse |
|
|
|
| 09 May 2014 01:52 PM |
| It would be quite a bit faster if it also checked if #items[i]:children()>0 before doing the function call though. Or else it builds an entire Lua function frame that is essentially a no-op. |
|
|
| Report Abuse |
|
|
Merely
|
  |
| Joined: 07 Dec 2010 |
| Total Posts: 17266 |
|
|
| 09 May 2014 02:59 PM |
| I'd bet that recursive FindFirstChild will be faster than recursion in Lua. |
|
|
| Report Abuse |
|
|
|
| 09 May 2014 03:01 PM |
repeat until game:FindFirstChild("INfecTION",true):Destroy()
relies on erroring when it's not found to break the loop :o |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 09 May 2014 04:26 PM |
repeat until game:FindFirstChild("INfecTION",true):Destroy()
uh
repeat until not game:FindFirstChild("INfecTION",true):Destroy()
|
|
|
| Report Abuse |
|
|
|
| 09 May 2014 04:29 PM |
| That would only remove one instance because :Destroy() doesn't return anything so it would break the loop. |
|
|
| Report Abuse |
|
|
lolb3
|
  |
| Joined: 16 Jan 2010 |
| Total Posts: 2268 |
|
|
| 09 May 2014 04:39 PM |
| hm not nil = true so yeah you're right |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 10:42 PM |
| Hey you admins responded hehe :D |
|
|
| Report Abuse |
|
|
|
| 18 May 2014 10:48 PM |
| When doing this, if it doesn't work, disable all of your plugins. It should work afterwards. Then, one by one, enable them and see which one creates the viruses. Remove it. |
|
|
| Report Abuse |
|
|