generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Question and help.

Previous Thread :: Next Thread 
Grizdor is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. Kodran
Joined: 15 Aug 2013
Total Posts: 5330
20 Jul 2016 07:11 PM
Remove is deprecated, use Destroy.
Report Abuse
Grizdor is not online. Grizdor
Joined: 07 Sep 2006
Total Posts: 30
20 Jul 2016 07:12 PM
Alright!


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image