OnServerEvent repeating even when client fires the server only once

This is my code and it prints twice even when client fires once (I have tried printing) Is it due to the fact that I am sending two values in the remote event?

Can you show the client part where you’re sending too. Cuz this looks fine

It worked perfectly fine until now when I encountered it.

K so problem is you’re using Mousbutton1click instead of mousebutton1down or mousebutton1up. Mouse button1click tracks down input and up input. Changing that should fix your issue

What should I change it to? Up or down?

Well doesn’t specifically matter down would just make it work when the mouse button was pressed down and mousebutton1up would make it only work when the button was released. So it’s personal preference

Didn’t fix it. As I said that I tried printing and the client isn’t firing the server twice. It’s just the server executing the code within it twice.

Then the only other issue would be the loop. And it can’t be executing on the server twice without the client sending the remote twice

Oh my god! I just found out that I had the same local script multiple times in my game. I had cloned the same gui to make more similar guis w/o deleting that script. SAD!

Edit: MouseButton1Click is better in my case because I want it to execute on a full click.

1 Like