|
| 22 May 2015 04:21 PM |
i have a script that says for i = 1,50 then removes brick5
but there arent 50 brick5s, so how can i make it so that it deletes brick5 until there is none left |
|
|
| Report Abuse |
|
|
| |
|
Unplane
|
  |
| Joined: 24 Mar 2015 |
| Total Posts: 38 |
|
|
| 22 May 2015 04:25 PM |
Please restate this, Idk what you mean by this.
"i have a script that says for i = 1,50 then removes brick5
but there arent 50 brick5s, so how can i make it so that it deletes brick5 until there is none left" |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:29 PM |
for i = 1,50 do game.Workspace.brick5:remove() end
there are 17 brick5 parts i dont want to change it so that its for i = 1,17, i want a script where it removes parts named brick5 until there are none left |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:31 PM |
| If you do i=1, 17 it should work. |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:31 PM |
| i dont want for i = 1,17, because there is another group of bricks that i need to remove and i really dont want to count them all |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:32 PM |
| Why don't you just group the brick5 parts and destroy the model when you want. |
|
|
| Report Abuse |
|
|
rayk999
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 4705 |
|
|
| 22 May 2015 04:32 PM |
local model = somewhere
for _,v in ipairs(model:GetChildren())do if v.Name == "brick5" then v:Destroy() end end |
|
|
| Report Abuse |
|
|
Unplane
|
  |
| Joined: 24 Mar 2015 |
| Total Posts: 38 |
|
|
| 22 May 2015 04:33 PM |
I DONT GET WHAT YOU ARE SAYING!?!?!?!!?!?
YOU ARE SAYING THAT THERE ARE ONLY 17 BRICK5's BUT YOU WANT TO REMOVE 50 OF THEM!?!?!?!?!? I DONT UNDERSTAND!?!!?!?!?! |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:33 PM |
Solution one:
Parent all of the bricks to a model Use :GetChildren() on the model Remove the parts
Solution two:
local Brick = game:FindFirstChild("brick5", true)
while Brick do -- code -- Set new Brick end
I gave you the "hard" parts, 2 lines are easy.. You need to develop problem solving :-\ |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
|
| 22 May 2015 04:33 PM |
for i,v in pairs(game.Workspace:GetChildren()) do if v.Name == "brick5" then brick5:Destroy() end end |
|
|
| Report Abuse |
|
|
Unplane
|
  |
| Joined: 24 Mar 2015 |
| Total Posts: 38 |
|
|
| 22 May 2015 04:34 PM |
@KLGA nice script copying skid.
You clearly copied Rayk's script and posted it for your own, It's like you want to feel imperial and be looked up to.
For some reason I never see that in the near future. |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:35 PM |
You could do that too, but I don't know the creator doesn't like models. So if there are 1000 parts; have fun with that. |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:35 PM |
| @Ryak right after I posted it lol |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:37 PM |
@unplane
everyone else understands what im saying
anyways, the bricks arent in a model they're spread out separately in workspace |
|
|
| Report Abuse |
|
|
KLGA
|
  |
| Joined: 19 Apr 2014 |
| Total Posts: 2571 |
|
| |
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:38 PM |
| Put them in a model then... |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:39 PM |
By separately, I assume in other models. So use mine. |
|
|
| Report Abuse |
|
|
| |
|
Tokimonu
|
  |
| Joined: 18 Sep 2009 |
| Total Posts: 643 |
|
|
| 22 May 2015 04:43 PM |
unplane is salty he can't script
checkm8 |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:44 PM |
| Sharp, you can make them models yourself... |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:46 PM |
i dont want to make the models the bricks are created in a script, and i dont know how to put them in models NOR feel the need to when i can simply use a script you're refusing to give me |
|
|
| Report Abuse |
|
|
Vritix
|
  |
| Joined: 01 Jan 2011 |
| Total Posts: 2790 |
|
|
| 22 May 2015 04:47 PM |
| It's harder when you have different sets of bricks that YOU don't want to count. |
|
|
| Report Abuse |
|
|
|
| 22 May 2015 04:48 PM |
i wont count them because i can use a script that you're refusing to give me [2] |
|
|
| Report Abuse |
|
|
morash
|
  |
| Joined: 22 May 2010 |
| Total Posts: 5834 |
|
|
| 22 May 2015 04:54 PM |
while workspace:FindFirstChild("brick5") do workspace:FindFirstChild("brick5"):Destroy() end
That was easy. |
|
|
| Report Abuse |
|
|