I’m using FireServer to let the server handle particle emitting. This is done through a LocalScript.
Every time you do the move in the GIF below, it will emit >10< particles on two emitters, and enable them as well.
What it's supposed to look like
However, the more I do this, for some reason the emit rate keeps increasing.
What it looks like after a while
Code that responds to FireServer and emits the particles
Does anyone know why it seems to be stacking the emit rate?
The code you’ve provided is not enough to fully diagnose the issue. The most likely situation is that either the function that emits the particles duplicates or the localscript itself duplicates. Here are some questions that may help:
Where is the localscript stored? Is it cloned and added to the player when the effect is meant to run, or is it always in the player?
Does the rate appear to increase after every use, or only when the player respawns?
It responds to an input, “F” to be exact. I’m using UserInputService for this:
Code
It’s very unlikely that spamming the key is the cause of this (because it literally wont let me). It just stacks up the emit rate every time I activate the move, no matter how much time there is between moves.
The issue is that a connected event stays connected until forcefully disconnected. In your case, this only happens when the player respawns.
Every single time you use the tool, you are connecting to KeyframeReached. This means that on the first use, it fires once, but on the second use, it fires twice, and so on.
To fix this, you should take the KeyframeReached event and put it outside of the UserInputService event. Assuming that “fireF” isn’t created dynamically within the UserInputService event, you should only need to declare the KeyframeReached event once.