Oaktin
|
  |
| Joined: 01 Sep 2013 |
| Total Posts: 119 |
|
|
| 13 Oct 2014 05:30 AM |
| If I have a model that has 100 Parts in it and I want it to select a random part until there is nothing left in the model. (i can make them remove) Please Help Thanks! |
|
|
| Report Abuse |
|
|
Syrt
|
  |
| Joined: 30 Sep 2011 |
| Total Posts: 2745 |
|
|
| 13 Oct 2014 06:14 AM |
Right Click > Select Children > Delete
"We only want more freedom or independence because we see other people with more than us." |
|
|
| Report Abuse |
|
|
|
| 13 Oct 2014 07:49 AM |
local model = yourModelHere
for i = 1, #model:GetChildren() do model:GetChildren()[math.random(1,#model:GetChildren())]:Destroy() wait(0.2) end
this will remove every thing in your model, one at a time, randomly selected. |
|
|
| Report Abuse |
|
|
|
| 14 Oct 2014 10:16 AM |
The above solution does work- but each time you MUST delete the brick in order to randomly select a different one from the remaining parts. This script allows a much more controlled way of doing so:
local m = workspace.Model -- replace this with your model local parts = m:GetChildren() for i=1, #parts, 1 do local n = math.random(1,#parts) local part = parts[n] table.remove(parts,n) -- doesn't destroy the brick, but removes it from the data still waiting to be used --do the method here on variable "part", e.g. part:Destroy() end |
|
|
| Report Abuse |
|
|