|
| 25 Nov 2012 06:09 PM |
How do i make this script Delete Models with it when it touches?
function onTouched(hit) local names = {"pie", "omg", "hackr", "pls"} -- Insert any names you want here. for k,v in pairs(names) do if hit.Name == v then wait() hit:Destroy() end end end script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 06:13 PM |
| Come On Anyone Someone Please Help |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2012 06:17 PM |
names = {"pie", "omg", "hackr", "pls"}
script.Parent.Touched:connect(function(hit) if names[hit.Name] ~= nil then hit:Destroy() end end)
|
|
|
| Report Abuse |
|
|
| |
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 25 Nov 2012 06:34 PM |
names = {"omg","crouton04","is","so","epic"} function ontouch(hit) for i,v in pairs(names) do if hit.Parent.Name == v then wait() v:Remove() else print("This is not able to be deleted!"} end end end script.Parent.Touched:connect(ontouch)
|
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 25 Nov 2012 06:35 PM |
| Sorry this is if it's in a model or something.. |
|
|
| Report Abuse |
|
|
crouton04
|
  |
| Joined: 07 Jul 2010 |
| Total Posts: 4459 |
|
|
| 25 Nov 2012 06:37 PM |
Change this part to make it if it's just a brick alone..
if hit.Parent.Name == v then |
|
|
| Report Abuse |
|
|