I have a basic fist combat script that makes the user punch whenever they click. A local script sends info that the user clicked to a server script that checks for serverside conditions that ensure the player is allowed to punch (not on cooldown or stunned). That same server script then creates a region3 in front of the player (using rotatedregion3 module) to check which players to hit.

After this, I use a binded event to communicate with other server scripts inside the hit players. They all do the same thing: damage the player, knock them back, and apply stun. So basically I separated the parts where the game checks if a player is hitting someone from what happens when they are hit. I discovered an issue in that if I hit another player, there is a pretty long delay before the "effect" script is processed. It takes around a full second, which is a lot and makes it seem very unresponsive.

I'm wondering if this is related to the fact that I have two scripts intended to complete a single action, but I'm reluctant to try making them into one because I'm afraid the wait timers in the "effect" script would pause the process the "cause" script (which continues even after so it can handle cooldowns and such.

4 comments

0

How long is your script, and is there any "wait()" in it?

0

How long is your script, and is there any "wait()" in it?

0

there are several wait timers in both scripts. I've considered maybe instead storing "tick()" at different points for different actions and combining them but I want to hear if there are any alternatives first

0

by combining i mean combining the cause and effect scripts