|
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
|
|
ToboboTJoin Date: 2011-06-25 Post Count: 2385 |
try this
while true do
BRICKNAME.touch.CanCollide = false
BRICKNAME.Transparency = 1
wait(1)
BRICKNAME.touch.CanCollide = true
BRICKNAME.Transparency = 0
end |
|
FriazaJoin Date: 2008-12-26 Post Count: 6229 |
function DeleteOtherPart(Part)
if Part:FindFirstChild("ACertainScript") then
script.Parent:remove()
end
end
script.Parent.Touched:connect(DeleteOtherPart) |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
:Remove() is deprecated. Use :Destroy() instead. |
|
FriazaJoin Date: 2008-12-26 Post Count: 6229 |
Yolo |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
ogm get out |
|
ToboboTJoin Date: 2011-06-25 Post Count: 2385 |
Ye Friaza you suck at scripting soo hard ya frub (#swegfest2011)
xD |
|
|
says the one with a bronze scroll
you know what that reminds me of
a penny
pennies are useless |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
I said 'get out' because he said 'Yolo.'
I hate yolo. |
|
shonclubJoin Date: 2009-09-05 Post Count: 1331 |
Who cares, remove() works too, in this case. |
|
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
@shon, it may still work but it is bad practice to use it because it is deprecated. |
|
shonclubJoin Date: 2009-09-05 Post Count: 1331 |
I never said it was good. Now did I? :P |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
You said "who cares", implying that is doesn't matter. |
|
shonclubJoin Date: 2009-09-05 Post Count: 1331 |
Correct, I never said it was good nor bad. |
|
ToboboTJoin Date: 2011-06-25 Post Count: 2385 |
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 |
|
|
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. |
|
ToboboTJoin Date: 2011-06-25 Post Count: 2385 |
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) |
|
ToboboTJoin Date: 2011-06-25 Post Count: 2385 |
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? |
|
|
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. |
|
JuddilyJoin Date: 2008-08-24 Post Count: 4243 |
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) |
|
FriazaJoin Date: 2008-12-26 Post Count: 6229 |
@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. |
|
ZachBloxxJoin Date: 2013-06-26 Post Count: 2833 |
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. |
|