|
| 20 Sep 2016 04:37 PM |
| Someone ####### up a game I built and I made a script that deletes the script that screws it up. Keep in mind there's over 500+ of these ####### up scripts. So, the script I made to destroy it only deletes it if its under workspace and it's a part that has the script in it. How do I make it so it deletes it in everything, not just if the script is in a part. Here's the script by the way: while true do for i,v in pairs(game.Workspace:GetChildren()) do if v.ClassName == "Part" then for i,v in pairs(v:GetChildren()) do if v.ClassName == "Script" then if ######## ## "require( NUMBER IN THE SCRIPT (HIDING IT FOR CONFIDENTIALITY) )" then v:Destroy() print("1 virus script down") else print("No script found in this location") end end end wait(0.5) end wait(.05) end end |
|
|
| Report Abuse |
|
|
igunaa
|
  |
| Joined: 15 Sep 2010 |
| Total Posts: 2588 |
|
|
| 20 Sep 2016 04:38 PM |
Goo`ld free model "viruses" lold.
Said the wise. |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 04:40 PM |
First of all, it's not a FM. It's in a team create and the person that left used a script to implant it everywhere in workspace.
|
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 05:04 PM |
someone help please. :|
also sorry for the roblox hashtags. smh
|
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 05:27 PM |
just use workspace filtering and type in 'script' it'll locate everything that has a classname of 'script'. |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Sep 2016 08:44 PM |
Like I said, there's over 500 of these scripts and I have my own scripts also that are named script
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 20 Sep 2016 08:47 PM |
local name = 'Virus'
Kill = function(name,location) for i,v in next, location:GetChildren() do if v.Name == name then v:Destroy() end Kill(name,v) end end
Kill(name,game)
|
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 08:49 PM |
Does that read every single object in workspace even if it's a descendant of a another object?
|
|
|
| Report Abuse |
|
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
| |
|
|
| 20 Sep 2016 08:53 PM |
local name = 'Virus'
Kill = function(name,location) for i,v in next, location:GetChildren() do if v.Name == name then v:Destroy() end Kill(name,v) end end
Kill(name,game)
So, what I'm getting here is: --> Replace 'location' with Workspace (Where it is) --> Replace name with the script name
and run it?
|
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 20 Sep 2016 08:54 PM |
local part=game:FindFirstChild('Virus',true) repeat part:Destroy()part=game:FindFirstChild('Virus',true)until not part |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 08:57 PM |
I want it to destroy the script if it has the source I provide it with (using script.Source)
Not just destroy every single script
|
|
|
| Report Abuse |
|
|
|
| 20 Sep 2016 09:03 PM |
@ilike
That only deletes it if its a child in workspace. I want it to delete it that way and if it's in another child of workspace.
So example:
Workspace
v Model v Part Script (Inside another object within workspace) v Part Script (Inside another object within workspace) Script (Under workspace directly; your script only deletes these)
|
|
|
| Report Abuse |
|
|
iIikeyou
|
  |
| Joined: 07 Mar 2012 |
| Total Posts: 1659 |
|
|
| 20 Sep 2016 09:06 PM |
| when you give a second argument of true to findfirstchild, it searches all descendants |
|
|
| Report Abuse |
|
|
| |
|
TimeTicks
|
  |
| Joined: 27 Apr 2011 |
| Total Posts: 27115 |
|
|
| 20 Sep 2016 09:25 PM |
@OP
local name = 'Virus' local location = workspace
Kill = function(name,location) for i,v in next, location:GetChildren() do if v.Name == name then v:Destroy() end Kill(name,v) end end
Kill(name,location)
:)
|
|
|
| Report Abuse |
|
|