yoshiwars
|
  |
| Joined: 27 Jul 2009 |
| Total Posts: 216 |
|
|
| 03 Jul 2013 01:59 PM |
This script breaks when you click the button and it doesn't find any "Red" or "Blue" how can I avoid that it breaks when you click?
lim = game.Workspace.lineone.Limit bin = script.Parent
function onClicked(mouse) script.Parent.ClickDetector.MaxActivationDistance = 0
for i,v in pairs(workspace:GetChildren()) do if v.Name == "Red" or v.Name == "Blue" then v:remove()
wait(0.5)
script.Parent.ClickDetector.MaxActivationDistance = 10 end end end
bin.ClickDetector.MouseClick:connect(onClicked) |
|
|
| Report Abuse |
|
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
|
| 03 Jul 2013 02:01 PM |
| is it a name or a brickcolor...............? |
|
|
| Report Abuse |
|
|
yoshiwars
|
  |
| Joined: 27 Jul 2009 |
| Total Posts: 216 |
|
| |
|
|
| 03 Jul 2013 02:15 PM |
lim = game.Workspace.lineone.Limit --I don't know what this does, but it's not used in this section. bin = script.Parent
bin.ClickDetector.MouseClick:connect(function() bin.ClickDetector.MaxActivationDistance = 0
for i,v in pairs(workspace:GetChildren()) do if v.Name == "Red" or v.Name == "Blue" then v:remove() wait(0.5) end
bin.ClickDetector.MaxActivationDistance = 10 end end) |
|
|
| Report Abuse |
|
|
yoshiwars
|
  |
| Joined: 27 Jul 2009 |
| Total Posts: 216 |
|
| |
|