Switching Weapon Script

hey I was wondering how to make a switching script for weapons…I have looked at some of the scripts but I need one that is used on a warship… :stuck_out_tongue: the warship has a deck gun and missiles

I would like to know how to write a weapon switching script that will work for this that will switch to missiles( secondary) when I press 2 and switch to the deck gun when I press 1.

I know little to nothing about scripting so I am asking you

Like in World Of Warships?

Let’s say both guns have their own script on them, where they shoot, rotate, follow mouse etc…

What you need to do is, deactivate and activate those scripts on buttonpress on your needs.

Or just set a bool to true or false to which ever gun should be activated/deactivated.

How did you build up the firing?

so how would I build the script to switch weapons…Could you show me how to do it?