dmjoe
|
  |
| Joined: 01 May 2009 |
| Total Posts: 2387 |
|
|
| 29 Nov 2012 05:19 PM |
taco = cheese:FindFirstChild() local ponies = taco:GetChildren() for i = 1,#ponies do if ponies.ClassName == "Script" then ponies:Remove() if ponies.ClassName == "LocalScript" then ponies:Remove() end end end
What's wrong with this? 'Cheese' is a model with a tool inside of it. Output: Argument 1 missing or nil. |
|
|
| Report Abuse |
|
|
dmjoe
|
  |
| Joined: 01 May 2009 |
| Total Posts: 2387 |
|
|
| 29 Nov 2012 05:21 PM |
| (The first child of cheese will always be a tool) |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2012 05:23 PM |
You never told FindFirstChild() what to find.
-[::ƧѡÎḾḠΰῩ::]-[::Helper of Scripting and Writer of Wikis::]- |
|
|
| Report Abuse |
|
|
dmjoe
|
  |
| Joined: 01 May 2009 |
| Total Posts: 2387 |
|
|
| 29 Nov 2012 05:40 PM |
I want it to find whatever is there. The tool's name differentiates. |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2012 05:47 PM |
If it's always the first thing, couldn't you be like. taco = cheese[1]--? O: Idunno |
|
|
| Report Abuse |
|
|
|
| 29 Nov 2012 05:49 PM |
Nu wait that won't work... :c taca = cheese:GetChildren() taco = taca[1]
|
|
|
| Report Abuse |
|
|
|
| 29 Nov 2012 05:51 PM |
taco = cheese:FindFirstChild()[1] local ponies = taco:GetChildren() for i, v in pairs(ponies) do if v:IsA("Script") or v:IsA("LocalScript") then v:Destroy() end end
¤¤ †KMXD† ¤¤
|
|
|
| Report Abuse |
|
|
|
| 29 Nov 2012 05:54 PM |
Ah, yes, :GetChildren(), not :FindFirstChild().
¤¤ †KMXD† ¤¤ |
|
|
| Report Abuse |
|
|
miniTeam
|
  |
| Joined: 28 Oct 2012 |
| Total Posts: 27 |
|
| |
|