Hey guys, Queue here. Just need a little assistance. So, I’m in the midst of creating a new game that involves guns. I wanted to add fire select, in which I’m in the process of doing. Currently, all of the change-able variables are located in a module script. Now, with the fire select function, in order to all for some customization and save on some lines of code, I’ve stored all the possible firing modes in a separate table in my module, see image below.
I have the table set up as well as the key-bind function set up as well/ (see image below as well)
Now, what has me stumped is how would I go about programming a function in which when a key is pressed, returns a value (value in this case being a firing mode) in the array, and when pressed again, returns the other values within my array?
Other Comments
- The reason I choose to store the firing modes in that array instead of writing in the main script within the function is
A. I want to keep the system customize-able as possible
B. The main script is linked with a package link
C. I want to keep the time manually configuring options in my system as low as possible
D. Some guns may not be able to select through a certain mode for realism reasons and such, so it’d be better if each gun had their own personal firing selection modes. - Are there other ways that I can approach this without needing to create an array with the settings module?
Thank you for the assistance/feedback! If you need any other images to better find the solution(s), mention me in a reply and I’ll get back to you ASAP.