Alpal425
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 214 |
|
|
| 30 Dec 2013 04:29 PM |
Trying to make a clear lag script. I saw that usually with a clear lag script, it will say "Removing Debris in (amount of time)". And there is a folder called Debris, so does it remove everything that's like hats and stuff? And if so, I am trying to learn this little clear all children command. The wiki says (as an example to help understand):
model = game.Workspace.Model in1 = Instance.new("Part", model) in2 = Instance.new("Sparkles", model) game.Workspace.Model:ClearAllChildren() --the part and sparkles in the model will be removed, but the model will remain
Still trying to learn scripting so don't judge please. :c
So, if I did..
DF = game.Debris
function ClearAll()
game.Debris:ClearAllChildren wait(180)
end)
Would that work or not? If not please help because I am still new to functions too!! |
|
|
| Report Abuse |
|
|
RoflBread
|
  |
| Joined: 18 Jun 2009 |
| Total Posts: 3803 |
|
|
| 30 Dec 2013 04:34 PM |
The Debris service is something different. If you're new to scripting, avoid it for now. I think this is more what you are looking for:
model_to_clear = Workspace.Model
function ClearAllChildren(model) model:ClearAllChildren() end
ClearAllChildren(model_to_clear) |
|
|
| Report Abuse |
|
|
Alpal425
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 214 |
|
|
| 30 Dec 2013 04:37 PM |
| But they are hats and stuff. You know, like when someone takes off their hat. |
|
|
| Report Abuse |
|
|
|
| 30 Dec 2013 04:39 PM |
k hold on
m=Instance.new("Message", game.Workspace) while true do wait(10) for i = 1,5 do m.Text = "Removing debris in: "..6-i wait(1) end for i,v in pairs(game.Workspace:GetChildren()) do if v:IsA("Hat") then v:remove() end end end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 30 Dec 2013 04:40 PM |
| Dropped hats are not stored in Debris |
|
|
| Report Abuse |
|
|
Alpal425
|
  |
| Joined: 29 Mar 2011 |
| Total Posts: 214 |
|
|
| 30 Dec 2013 04:50 PM |
| But then the message gets stuck there and doesn't go away! D: |
|
|
| Report Abuse |
|
|