|
| 11 Jun 2015 04:53 PM |
So I tested this and it won't work..... No idea whats wrong.
local Targets = {"Workspace"}
local cleanTime = 30 local Countdown = 5
local function Cleanup() print("Cleaning!") end
while wait(cleanTime) do for _,v in ipairs(Targets) do for _,v2 in ipairs(game[v]) do if v2 ~= nil then Cleanup() end end end end |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2015 04:54 PM |
| I think you need to change local Targets = {"Workspace"} to local Targets = game.Workspace |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2015 04:55 PM |
| What if I wanted multiple targets? |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2015 04:59 PM |
local Targets = { "game.Workspace", "game.Workspace.Part"}
I think but if it don't work then IDK I haven't worked much with this kind of scripting
|
|
|
| Report Abuse |
|
|
Saldor010
|
  |
| Joined: 20 Sep 2010 |
| Total Posts: 1035 |
|
|
| 11 Jun 2015 05:00 PM |
Try this:
for _,v2 in ipairs(game[v]:GetChildren()) do |
|
|
| Report Abuse |
|
|
|
| 11 Jun 2015 05:02 PM |
| All I know is that you have to have game.Workspace or game.Players for other stuff but try what he has given you |
|
|
| Report Abuse |
|
|