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 » Scripters
Home Search
 

Re: A simple clean script

Previous Thread :: Next Thread 
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
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
FaZeRoster is not online. FaZeRoster
Joined: 05 Jul 2013
Total Posts: 265
11 Jun 2015 04:54 PM
I think you need to change local Targets = {"Workspace"} to local Targets = game.Workspace
Report Abuse
iSpecializinq is not online. iSpecializinq
Joined: 31 May 2015
Total Posts: 2182
11 Jun 2015 04:55 PM
What if I wanted multiple targets?
Report Abuse
FaZeRoster is not online. FaZeRoster
Joined: 05 Jul 2013
Total Posts: 265
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 is online. 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
FaZeRoster is not online. FaZeRoster
Joined: 05 Jul 2013
Total Posts: 265
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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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