Everything works fine in testing, Multiplayer falls apart

Hello,

I have a gun that for SOME REASON I’ve been working for 3 days straight on, is just not acting normal anymore. What I THOUGHT was a good working gun, was just a bunch of bugs.

For example:
image
Names get all messed up (for some reason)


This error which I don’t know how to fix keeps popping up
image
And my raycast filtering doesn’t work. Can anybody help improve my script(s)? I have 2 local scripts and 2 server scripts but I doubt anybody would want to help me with that, if not… Is there anything I can do to fix these problems? Anything helps. I would really like it if somebody helped improve my scripts

Note: I do know the difference between local and server. I don’t know why its acting like everything is local.