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

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

Asked by 3 years ago

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

Log in to vote
1
Answered by
ElBamino 153
3 years ago
Edited 3 years ago

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!

0
Thanks! I'm a beginner scripter and i was just looking for how to make it more smooth. It works! thnks epic_hen9 27 — 3y
0
No problem! I'm glad it worked. ElBamino 153 — 3y
Ad

Answer this question