Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

✓ Accepted answer

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!

2 comments

0

Thanks! Just what i needed.

0

No problem, good luck!

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);

This discussion is preserved as it was. New answers, comments, and votes are closed.