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

How would I make a part, when clicked, make a ParticleEmitter turn on or off?

I want to make a normal part with a script that makes another part with a ParticleEmitter inside of it turn on with a click and off with another click? Help appreciated.

epic_hen9

1 answer

✓ Accepted answer

This is my first time answering a question so bear with me. I will not write the script for you because this help site not a request site but, here's some friendly advice! First, I recommend checking out this link on what a "ClickDetector:MouseClick" is. Link here:

https://developer.roblox.com/en-us/api-reference/event/ClickDetector/MouseClick

Second you would put a ClickDetector object inside of the part.

Third you would run a function similar to this (I did not test this but, I know it works.)

local ClickDetector = Part:WaitForChild("ClickDetector")
ClickDetector.MouseClick:connect(function(Player)

Fourth you need to put the ParticleEmitter inside of the part and call it.

local pe = script.Parent.ParticleEmitter

Adding onto this you find what you want inside of pe so enabled. To change this you would

pe.Enabled = true
--do whatever you want or reverse false and true not sure what you want
pe.Enabled = false

True is on, false is off.

Sorry, if I'm wrong. Just trying to help!

2 comments

0

Thanks! I'm a beginner scripter and i was just looking for how to make it more smooth. It works! thnks

0

No problem! I'm glad it worked.

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