|
| 25 Aug 2013 05:46 PM |
Hello, this script will help me with my game.
I have always wanted to learn scripting and I just know very little about it and trying to learn.
I want someone to tell me, make one, or help me out making a script that will make the part that the script is in disappear when it is touched by a part that has a certain script in it.
That way it will only reacts to a certain part, not any kind of part.
Thanks for any help, it is appreciated. Newholland1
|
|
|
| Report Abuse |
|
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 25 Aug 2013 06:07 PM |
try this while true do BRICKNAME.touch.CanCollide = false BRICKNAME.Transparency = 1 wait(1) BRICKNAME.touch.CanCollide = true BRICKNAME.Transparency = 0 end |
|
|
| Report Abuse |
|
|
Friaza
|
  |
| Joined: 26 Dec 2008 |
| Total Posts: 6229 |
|
|
| 25 Aug 2013 06:10 PM |
function DeleteOtherPart(Part) if Part:FindFirstChild("ACertainScript") then script.Parent:remove() end end script.Parent.Touched:connect(DeleteOtherPart) |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 25 Aug 2013 06:11 PM |
| :Remove() is deprecated. Use :Destroy() instead. |
|
|
| Report Abuse |
|
|
Friaza
|
  |
| Joined: 26 Dec 2008 |
| Total Posts: 6229 |
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
| |
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 25 Aug 2013 06:17 PM |
Ye Friaza you suck at scripting soo hard ya frub (#swegfest2011)
xD |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 06:18 PM |
says the one with a bronze scroll you know what that reminds me of a penny pennies are useless |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 25 Aug 2013 06:19 PM |
I said 'get out' because he said 'Yolo.'
I hate yolo. |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 25 Aug 2013 06:21 PM |
| Who cares, remove() works too, in this case. |
|
|
| Report Abuse |
|
|
| |
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 25 Aug 2013 06:23 PM |
| @shon, it may still work but it is bad practice to use it because it is deprecated. |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 25 Aug 2013 06:24 PM |
| I never said it was good. Now did I? :P |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 25 Aug 2013 06:27 PM |
| You said "who cares", implying that is doesn't matter. |
|
|
| Report Abuse |
|
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
|
| 25 Aug 2013 06:28 PM |
| Correct, I never said it was good nor bad. |
|
|
| Report Abuse |
|
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 25 Aug 2013 06:33 PM |
| Iterations I got bronze because I dind't bring a laptop, now if you think about it that way, you can be a bit more swegilishous |
|
|
| Report Abuse |
|
|
|
| 25 Aug 2013 06:44 PM |
| That looks like it would react to any brick not a certain one. Or am I wrong? I'm just learning that's why I'm asking. |
|
|
| Report Abuse |
|
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 26 Aug 2013 05:38 AM |
Just use this for gosh golly sake...
function t(tt) if tt.Parent:FindFirstChild("Humanoid") then script.Parent:Destroy() end end
script.Parent.Touched:connect(t) |
|
|
| Report Abuse |
|
|
ToboboT
|
  |
| Joined: 25 Jun 2011 |
| Total Posts: 2385 |
|
|
| 26 Aug 2013 05:41 AM |
Think of it as a gun:
function t(tt) -- The gun it's self if tt.Parent:FindFirstChild("Humanoid") then -- This just makes sure that the thing that it is touching is human. script.Parent:Destroy() -- Destroys it, and this is the firing of the bullet end -- Ending the if statement end -- Ending the function
script.Parent.Touched:connect(t) -- The trigger, whenever the brick is touched you click the trigger, firing the gun.
I hope that helped? |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 04:19 PM |
I worked with it and it worked. But I tried putting a Humanoid into a brick and it wouldn't let me.
How do I change it so it works on a new Part and it is named, idk, Corn. |
|
|
| Report Abuse |
|
|
|
| 26 Aug 2013 04:25 PM |
Use this:
script.Parent.Touched:connect(function(Hit) if Hit.Name == "Put the name of the brick that you want to delete this brick in here" then script.Parent:Destroy end end) |
|
|
| Report Abuse |
|
|
Friaza
|
  |
| Joined: 26 Dec 2008 |
| Total Posts: 6229 |
|
|
| 27 Aug 2013 10:49 AM |
| @Zach, I hate your type a lot. You own scripting groups yet can't even finish a game. This thread is for helping people, not for elitist brats to spew their superiority around with no credibility. |
|
|
| Report Abuse |
|
|
ZachBloxx
|
  |
| Joined: 26 Jun 2013 |
| Total Posts: 2833 |
|
|
| 28 Aug 2013 07:56 AM |
| I have finished many games; my former account has over 4,000,000 visits. I made a new one because I felt I was categorized with the game developers that have tons of visits and think they're better than everyone. I have tons of credibility, if you would like me to showcase it, I can. |
|
|
| Report Abuse |
|
|