Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a part have an effect of touching another part?

Asked by 8 years ago

So say I have a part 1 with a script in it, that has the script for the thing to work. So say I want if part 1 touches part 2, part 1 gets the smoke effect (like the sparkle, fire effects), but if it's not it doesn't have the smoke effect. What would I put into the part 1 script to make that happen?

2 answers

Log in to vote
0
Answered by
Necrorave 560 Moderation Voter
8 years ago

Using the Touched event, you could attach a function that applies the desired effects to it.

We will not just give you the code, you will need to attempt that on your own.

I will at least give you a head start though!

Incomplete example:

part1.Touched:connect(function(part2)

--Code here

end)

Particles are not too difficult to work with, just have to do a bit of research and fool around until you get it right!

Particle info

Let me know if you have any other questions!

0
Thanks! Just what i needed. Supergamerboy1995 129 — 8y
0
No problem, good luck! Necrorave 560 — 8y
Ad
Log in to vote
0
Answered by 8 years ago

If I'm interpretting your question right, you want to trigger some effect only if Part 1 is touched by Part 2 and nothing else. This example assumes that Part 2 is named Part2

part1.Touched:connect(function(touched)
    if touched.Name == 'Part2' then
        -- add some effects here
        -- for example:
        -- Instance.new('Smoke', touched);
    end;
end);

Answer this question