Designing an FPS Framework: Beginner’s guide [PART 2]

Can you specify which line it’s occurring on?

sorry it hid where i put an indicator where it is, its the line just under the MainModule.weldgun at the top.

In the MainModule you should check if function cast has the same amount of parameters that you put in.

you mind sending the screenshot of the main module? im not quite sure how its supposed to look

oh sorry, didnt see that; thanks

Won’t exploiters be able to fire the damage remote event and damage anyone they like?

image
I already gave a reason why I did this.

So it’s still possible to handle the damage on server side without firing a remote from the client?

No, you still need to pass a request to indicate you’ve hit someone.

@EXM_0 Hey, I’m still kinda waiting for this one.

After messing around with my code, I was able to do the hit detection on the server without the client having to fire a remote server.

I wouldn’t recommend this because the hit detection wouldnt be accurately synchronised with the client.

Make sure the gun is properly welded, everything should be unanchored except for the viewmodel humanoidrootpart.

I used Heartbeat instead of RenderStepped for better synchronization but the actual ray on the server might still be desynchronised with the client’s bullet

I don’t know what you mean by this because it doesn’t really make a difference. My point is that when you use hit detection on the server it would be inaccurate because of delay. You can notice this when you use long range weapons.

1 Like

Yeah I fixed it afterwards, lol.

1 Like

Good point but i prefer it more compared to firing a remote server from the client, I’m gonna benchmark just in case.

Wouldn’t it be inaccurate anyway? The code in the tutorial shows how to make projectile weapons, and not actual hitscan weapons, so there’ll always be a delay.

This is the average time difference from 7 shots after benchmarking. Not sure if it makes a big difference.
image