#Help with strings and tables

6 messages · Page 1 of 1 (latest)

frail zenith
#

if i had a variable that was equal to a string how would I search for that in a table, for instance if
local weapon = "Pistol"
and i wanted to do, WeaponInfoTable.(the variable).damage, how would i do that

blissful kiteBOT
#

studio** You are now Level 3! **studio

echo barn
#

you could use a module script

#

local WeaponTable = {}

WeaponTable = {
["Pistol"] = {
Damage = #Damage
}
}

Return WeaponTable

#

require that module

#

and then do Module[Pistol]["Damage"]