How would I make a press keys in order system?

I’m making some sort of PvP key pressing battle system, so I want the player to have to press the shown keys quickly.

The amount of keys pressed would decide how strong the attack will be, I guess it will have a limit to avoid exploiters breaking everything.

But I’m not sure how this system would work exactly, since the amount the keys need to be taken from the client and used in the server, Would a remote function work? I thought of using Remote Events but, how would that work? Since the server would start the player’s turn and then… how would It wait for the amount of keys? Is there a way to wait for a specific player to fire an event?

Sorry if I explained myself poorly, my brain is not braining.

I guess you can have a workaround starting with Client with a timer to actually detect how many times the person pressed certain keys in their keyboard within the time limit.

After that, you’d just have to do a code that whenever a person presses a Key, a +1 value gets added that stacks.

And then you would use that to reference the damage to the enemy.

of course, you’d need to use RemoteEvents for that one, you’d send the Damage Value so that when server listens to it, it would know how much damage to inflict to enemy.

You’d need to work around Math code with this one too.

Couldn’t exploiters just edit the timer so it never runs out since it’s done in the client? or they could edit the damage done.

you can always do the time in server so that it’ll reflect the time for both players.

what about the damage? they could also edit the damage no?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.