How to start to make a weapon

the question is what are the steps to make a weapon from a shooting game? It should make the weapon, then a local script that sends the mouse position and plays the sounds and animations. and a server script that creates the Ray Cast and removes the damage? or am I wrong please if you read the topic contribute don’t stay silent it is stressful if you are not going to contribute
go and go straight for another topic

Do you mean making the actual weapon or how the weapon shoots?

For the actual weapon I would say, make the models, but keep on mind everything, barrel and projectile etc., after that,make the animations, and after start scripting the gun, and then you’re done

Also, if your topic has views but people is not answering, you shouldn’t be mad, sometimes not everybody and the answer to your question

Or sometimes the time it takes to get an answer is veeeery long, it happened to me…

1 Like

I understand you but my question is if I make a local script send a remote event to a server script when the weapon is activated and then the server script creates a ray cast. You know my question is: would it affect the game in optimization?

I’m not sure, I’m not an expert in this but I heard that you should do everything on the Client and replicate to the Server, or viceversa, what I would do is:
Player presses button, weapon raycasts and sees where the bullet will go, then Server gets info and creates the bullet and sends it to the raycasted position

Also, for optimisation, it depends, if you have like 200 weapons firing at the same time then yes, but if it’s a few then you wouldn’t see the lag

1 Like

I mean, with a local script, I would do everything about the position and that, and with the server one, create the lightning bolt and remove the damage?

No, you would only get the input and create the ray cast, as if you cretE the bullet locally only that player will see it, but yes, basically it’s:

  • Player presses input button
  • Weapon raycasts and stores the raycast info
  • Script sends the raycast info trough a remoteevent
  • Server creates bullet, lighting bolt, and etc.
  • (not needed) Server plays sound
1 Like