- Client gun controller
The client script that handle player input and after input send the message to server to make a shoot also handle all animations in the viewmodel and visual.
- Server-shoot
The server script that get message from client gun controller and after it make the list of functions before shoot and if all functions are true the shoot is beign true which makes with raycast.
- Viewmodel
The client script that handle the viewmodel control the position and so on.
Video. https://medal.tv/games/roblox-studio/clips/muI5X40lJjvYcupuk?invite=cr-MSxSRUYsNDQ3NTM2MTg1&v=50
so in this video you can see that sometimes gun is not correct position but the problem is not in my script because in roblox it still works correctly and also when other people use that gun in roblox studio that still works correctly for them I dont know actually why it doesnt work on my pc ig that the problem is when I enabled some of beta features.