How should I go about this gun system?

This was a concern I have (except well not with a raycast) as the player could just send a list of players to the server and then they’d all take damage, so the idea is to send all the enemies it hit on the client to the server, along with the direction the bullet traveled, I would then need to determine if the player that was hit on the client is somewhat close to where the bullet would have gone, that way it limits exploiters from just killing everyone lol.

That and probably some other predictions and stuff. But yeah thanks for the pointer!

How I would do it is probably send a request to the server to shoot a raycast from your character.

So instead of sending an array of hit enemies and the bullet direction(position and orientation) which is arguably more inefficient and still unsafe, you just send one request.

Everything else can be done/calculated on the server. Again if you are worried about server performance just use parallel lua.

What exactly is parrallel lua? And how can It help with this?

The reason I’d like to do this via the client is so the hit registration for the client is instant, you dont have to worry about different ping of the different players, and it’ll just feel better to use, if I did all the detections via the server there would be a noticeable delay, and a lot of your attacks would miss. Especially considering this game will probably have some movement mechanics, any delay would be detrimental to the feel of the game.

ps Im not using raycasts

So now you want the instant hit registration feel for the client, you could have said this in your previous posts/main post(unless I missed it).

If that’s the case then idea you suggested is the better solution here obviously.

As for parallel lua, (Idk if you’re being sarcastic with this considering that you have over 200 solutions) it’s just a way to balance and spread the workload which improves performance instead of handling everything on a single thread.

Now I’m not sure how your game works since you are sending in an array of hit enemies and you did say you aren’t using raycasts so I’m assuming it has something to do with using splash effects/aoe (GetPartBoundsInRadius/magnitude check) or similar.

1 Like

so basically what parrel lua is, is so it allows scripts to run at the same time, where as without it scripts would run one after the other?

gonna be real, this is the 4th time I’ve seen someone mention parrel lua lol.

Thanks for the help by the way!