XoM,
The code snippet below should help you. It is fully commented to step you through its processes and help you understand the method and how to use it. It's simple, really.
set display mode 800,600,32
sync on
sync rate 60
REM << we will use an array to simplify the process
dim gun$(5)
gun$(1) = "pistol"
gun$(2) = "shotgun"
gun$(3) = "9MM"
gun$(6) = "grenade"
gun$(7) = "rocket launcher"
REM <<<<<<< main loop >>>>>>>>
repeat
REM << here the variable 'guntype' will be incremented each time tab is pressed
REM << also, 'notype' is the variable I will use to keep the keypress "controlled"
if scancode() = 15 and notype = 0
inc guntype
REM << let's say that you have five types of guns, if 'guntype' rises above 5, make its
REM << value a 1 again
if guntype > 5 then guntype = 1
REM << here is where we keep the guntype from changing again on the next loop,milliseconds away
notype = 1
endif
REM << this line will only allow guntype to be changed again ,by pressing tab, AFTER tab is first let off of
if scancode() <> 15 then notype = 0
REM << this next line of code just show the method in action when executed
print gun$(guntype)
sync
cls
until mouseclick() > 0
end
REMSTART << in your program(game) you just need to make IF statements to use your specific gun code
EX:
if guntype = 1
code to run gun goes here
endif
if guntype = 2
code to run 2nd gun goes here
endif
etc.....
REMEND

+NanoBrain+