RemoteEvent double fires?

So I’m working on a project here inspired by The Division, and with it there’s features that require usages from the server, which means using remote events. I found a bug that I can’t fix however, when there’s only one player using the watch, everything works just fine. But when 2 players use the watch, the remote events I use seem to fire twice instead of just once?

Below is a 7 second clip showing me opening the watch which fires a remote event to the server, which then prints “Recieved ISAC event!”. As you can see, when there’s two people with the watch, it prints twice. But when it’s just me, it only prints once.


Below is the code regarding opening the menu:

					if input.KeyCode == Enum.KeyCode.Tab and inmenu == false and loadingup == false and czactive ~= true then

						inmenu = true

						sfx.LOAD_IN:Play()

						base.ISAC_MENU.Visible = true

						ts:Create(base.ISAC_MENU, TweenInfo.new(0.1), {Size = UDim2.new(0.655, 0, 0.759, 0)}):Play()

						equipanim:Play()

						rs.Events.ISAC:FireServer("MENU", "OPEN")

If you need additional details, please let me know. This one is frustrating for me.

Make a debounce even a simple task.wait(), this typically happens to me.

Where would I put it in the order? Should this be done before it registers the input? Or after it registers the input?

What is the function that is used to fire the input detection?

InputChanged , InputBegan or InputEnded?

InputBegan, I also check for if the gameprocessed first as well.

How many times is the function getting run? Maybe the script restarts and then it ends up firing twice due to the function listening more than once, if you understand what im trying to say

I attach the function to the inputbegan event with userinputservice. So the only time the event gets fired is when a player presses Tab. So I’m not so sure why it would be listening more than once. It’s a local script too.

I use a tab keycode to open my menu also, this is my code. Maybe it can help you?
image

Inside the inputbegan,

-- or whatever loop
local debounce = true;
inputBegan:Connect(function(input)
if debounce then
-- nothing
else
debounce = true
-- normal code
task.wait();
debounce = false;
end)

Unfortunately your method didn’t work, it still fires twice.

Check if the remote actually is firing twice and that’s it’s not just something in the server script. Maybe try putting a print inside the function that handles the remote.