So I have a table that looks something like this:
local weapons = {[46]= "Megapositron", [173]= "Sunflare", [702]= "raven"}
I also have a variable:
weaponid
The variable weaponid
will contain one of the keys from weapons (46,173,702)
What I can't figure out is how to check if weaponid matches one of those keys and upon weapon id matching a key I need it to assign the keys value to another variable named weaponname.
So suppose weaponid = 173 then weaponname = 'Sunflare'