Grizdor
|
  |
| Joined: 07 Sep 2006 |
| Total Posts: 30 |
|
|
| 20 Jul 2016 06:49 PM |
So I'm wondering if you can make a part remove when it touches a certain part. I don't have a attempt script because I don't even know where to begin. Also I'm asking if you can make a script on it. Thank you for your help!
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 06:53 PM |
wiki.roblox.com
some topics to look at:
Touched event Destroy method If statements Name property
an idea of how it would work:
When the part was touched { If the part that touched's name is "myPart" then Destroy the part end } |
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 20 Jul 2016 06:53 PM |
script.Parent.Touched:connect(function(touch) -- We connect to the touched event. http://wiki.roblox.com/index.php?title=API:Class/BasePart/Touched if touch == game.Workspace.yourpart then -- We see if it touched the certain part. You can change this. script.Parent:Destroy() -- We kill the parent of the script, which is the part. end end) |
|
|
| Report Abuse |
|
|
kools
|
  |
| Joined: 11 Jan 2009 |
| Total Posts: 1659 |
|
|
| 20 Jul 2016 06:54 PM |
| I'm sorry Kodran. I should have left him or her to learn it and not jump the gun. : / |
|
|
| Report Abuse |
|
|
Grizdor
|
  |
| Joined: 07 Sep 2006 |
| Total Posts: 30 |
|
|
| 20 Jul 2016 06:55 PM |
It's ok, I'm actually reading the wiki for BasePart/Touched right now.
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 06:57 PM |
| Nice! I encourage you to continue learning after making this on your own as well. Useful skill to have, plus you'll be able to create anything you want once you get the hang of it. |
|
|
| Report Abuse |
|
|
Grizdor
|
  |
| Joined: 07 Sep 2006 |
| Total Posts: 30 |
|
|
| 20 Jul 2016 06:58 PM |
Thanks for the support man :D I'm still learning and my goal is to get "good" at lua.
|
|
|
| Report Abuse |
|
|
Grizdor
|
  |
| Joined: 07 Sep 2006 |
| Total Posts: 30 |
|
|
| 20 Jul 2016 07:09 PM |
I came out with this script I tried doing it without looking at the script you gave me and just doing it free from the wiki, and it works! I looked back at mine and yours and I realized I but "Remove" instead of "Destroy" I guess i'm just more familiard with it.
script.Parent.Touched:connect(function(touch) if touch == game.Workspace.fer then script.Parent:Remove() end end)
|
|
|
| Report Abuse |
|
|
Kodran
|
  |
| Joined: 15 Aug 2013 |
| Total Posts: 5330 |
|
|
| 20 Jul 2016 07:11 PM |
| Remove is deprecated, use Destroy. |
|
|
| Report Abuse |
|
|
Grizdor
|
  |
| Joined: 07 Sep 2006 |
| Total Posts: 30 |
|
| |
|