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

Remote Events Trigger Twice?

So I've already done a lot of digging into this issue and I can confirm that only ONE script is calling :FireServer() on my events ONE time.

Basically, theres a script that is in PlayerScripts that runs 70% of a clients core code. Anytime it doesn't need to be running, specifically in the short time between a character's death and their respawn, this script is disabled and re-enabled anytime it's needed. This works pretty well, I've checked everything, it seems like a solid system.

The issue is this script calls all sorts of remote events for different things. After it's disabled and re-enabled just once; anytime it calls :FireServer(), on the server's end the remote event is fired twice. It's always twice, nevermore, neverless.

I assume it's related to the disable/enable system, but I can't be sure. I've already double and triple checked. No code in the script runs twice. Just remote events getting triggered twice.

Is there some kind of replication I need to watch out for? Why is this happening?

1 answer

Nevermind guys, it seems like this is a common issue with roblox and just the act of calling :connect() on the OnServerEvent() signal can cause the event to fire again. I guess the best way to solve it currently is to make our own debounce on the event.

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