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

Adding particles to a gun firing?

I understand particles and how to add them to parts. But what I'm really lost with is how to add temporary particles, more specifically, particles for guns. I don't know how to code my particles so that they appear only for a fraction of a second when firing a gun, then make them disappear. Any help would be greatly appreciated because I really need gun particles to make my game realistic.

1 answer

I suppose what would work is after the fire event making it non-Transparent then doing like a wait(.1) then making it Transparent once more

Example Edit:

function fire()
script.Parent.ParticleEmitter.Transparency = 0
wait(.1)
script.Parent.ParticleEmitter.Transparency = 1

P.S. I'm not very good at scripting guns, but this is merely an example of what I think it should look like.

3 comments

0

I understand your answer and I’ve been playing around with it, but I can’t figure out how to code a transparency change for a particle emmiter. I can code a transparency change for parts, but not a particle emmiter. Could you give me an exmaple or something.

0

I gave you an example of what I think could work in my answer.

0

Thanks for the example. After a lot of testing, I discovered that the transparency of a ParticleEmitter can't be set in a script, as far as I know. Instead, I set the rate to 0 and set it to 100 every time the weapon is fired. It produces a very similar effect and uses a very similar script to yours. Thank you for pointing me on the right track.

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