Where to do moves

So I’m making a system where a player will click a keybind and a move will play alongside an animation that controls when specific things happened - like the hitboxes. But I’m not sure where to do the moves since I cannot do it locally as it will not show to all the clients, but if I do it on the server it may cause lag. So the only solution I could think of is to fire a RemoteEvent to the server that Fires to all clients then do the Move on each client individually. But two things are that how would I do the hitboxes? And, and that this would take atleast 200ms which is too big of a delay. I know a lot of games have a good move framework, if anyone could help me out, it’d be much appreicated.

Can you please show your script?

Really sorry I had forgot about this.

I haven’t even began scripting anything yet, and was just brainstorming how I would go about making moves. But I’ll give you a run down on my idea

Player clicks a bind - let’s say E, then a move - like an explosion happens, with a hitbox that damages all players in it.

For the move to show on all clients I can either do it on the server or FireAllClients, since I’ll have to do hitboxes on the server anyways. But this would have a big delay since it’s going Client → Server → Client

I’m new to scripting so take this with a grain of salt but maybe putting it inside of a gui with a remote event tethered to the move system? Just some thoughts.

Use the client to trigger animations and fire a RemoteEvent to the server to validate and apply hitbox logic. Handle hitboxes and move interactions on the server to avoid exploits. Sync the visual effects by broadcasting the event to all clients once validated.

1 Like

Would this not have a big delay

There might be a tiny delay because of the RemoteEvent communication, but if you let the client predict and show the animation immediately, while the server handles the validation and syncs everything afterward, the delay should be barely noticeable. It’s a good balance between responsiveness and security.

1 Like