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

Remote Events Trigger Twice?

Asked by 6 years ago

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

Log in to vote
0
Answered by 6 years ago

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.

Ad

Answer this question