Arn
Member
- Joined
- Mar 8, 2010
- Messages
- 282
- Reaction score
- 18
Hi, I'm trying to get a global variable in a strange way. Please take a look and see if you can tell what I need to do. (will +rep)
This is the recipe for the weapon.
This is the table/array that I'm using to access the different recipes.
Now heres what I'm trying to do.
It should find that the itemid is 2423. Instead it says the value is nil. I tried stringToVariant assuming that that function converts a string to a variable, but that didn't work. Any suggestions?
-Arn
This is the recipe for the weapon.
Code:
--8000
RECIPE_CLERICAL_MACE = {
itemid = 2423,
mats = {5880},
count = {10},
cost = 300
}
This is the table/array that I'm using to access the different recipes.
Code:
craftingList =
{
[0] = {id = 8000, name = 'clerical mace', label = 'RECIPE_CLERICAL_MACE'},
[1] = {id = 8001, name = 'jagged sword', label = 'RECIPE_JAGGED_SWORD'},
[2] = {id = 8002, name = 'orcish axe', label = 'RECIPE_ORCISH_AXE'},
[3] = {id = 8003, name = 'spike sword', label = 'RECIPE_SPIKE_SWORD'}
}
Now heres what I'm trying to do.
Code:
local var = craftingList[0].label.itemid
It should find that the itemid is 2423. Instead it says the value is nil. I tried stringToVariant assuming that that function converts a string to a variable, but that didn't work. Any suggestions?
-Arn