giodor
|
  |
| Joined: 04 Dec 2011 |
| Total Posts: 113 |
|
|
| 09 Dec 2014 12:58 PM |
Hello,
I've been trying to get this script to work, but it's not working for some reason. I'm a scripting starter, so you'll probably all face-palm but please do help. The thing I'm trying to do is find a part in Workspace named Ink, and then remove it. But, I want it to remove ALL parts named Ink, not just the first one it founds. My ideas:
local Ink = game.Workspace:FindFirstChild("Ink", true) function Clicked() Ink:remove() script.Parent.ClickDetector.MouseClick:connect(Clicked) end
Or:
function Clicked() if Ink.Name = "Ink" Ink:remove()
script.Parent.ClickDetector.MouseClick:connect(Clicked) end
I had some other tries, but they also didn't work out. Please help! |
|
|
| Report Abuse |
|
|
Crythox
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1188 |
|
|
| 09 Dec 2014 01:24 PM |
for i,v in pairs(game.Workspace:GetChildren()) do if v.Name == "Ink" then v:Destroy() end end |
|
|
| Report Abuse |
|
|
giodor
|
  |
| Joined: 04 Dec 2011 |
| Total Posts: 113 |
|
|
| 09 Dec 2014 01:28 PM |
| I still need a clicked function in it and I don't know how to integrate that with the clicked function, please help? |
|
|
| Report Abuse |
|
|
giodor
|
  |
| Joined: 04 Dec 2011 |
| Total Posts: 113 |
|
| |
|
|
| 09 Dec 2014 03:19 PM |
| I also dont know how to do script at all and if u can give me some tips that will be helpful |
|
|
| Report Abuse |
|
|
giodor
|
  |
| Joined: 04 Dec 2011 |
| Total Posts: 113 |
|
|
| 09 Dec 2014 03:26 PM |
| Ugh, I was getting excited that someone had a fix.. |
|
|
| Report Abuse |
|
|
giodor
|
  |
| Joined: 04 Dec 2011 |
| Total Posts: 113 |
|
| |
|
Crythox
|
  |
| Joined: 03 Oct 2011 |
| Total Posts: 1188 |
|
|
| 10 Dec 2014 09:50 AM |
._.
script.Parent.ClickDetector.MouseClick:connect(function() for i,v in pairs(game.Workspace:GetChildren()) do if v.Name == "Ink" then v:Destroy() end end end) |
|
|
| Report Abuse |
|
|