I want to get two seperate instances of cursor values in my clientX/Y; method in JavaScript

Hello,

If I understand what you are trying to achieve it’s to be able to store the position of the cursor but every time we click it’s the other client’s turn to store the pos.

What you can do is to use modulo (%) to know which client is clicking.
You declare a variable counter = 0 and every time you click, the counter is incremented. Then you check if the counter is even or odd.

I did this to demonstrate :

I Hope I understood your question and not off topic.

2 Likes