Precisa dar um loop, tenta assim,
local config = {
[ItemID] = {Life = 900, sword = 31, axe = 36, club = 42, lookType = 1, vocation = 1, effect = 45, msg = "ClasseName"}, [ItemID] = {Life = 900, sword = 54, axe = 92, club = 35, lookType = 1, vocation = 1, effect = 45, msg = "ClasseName"}, [ItemID] = {Life = 780, sword = 46, axe = 53, club = 66, lookType = 5, vocation = 2, effect = 15, msg = "ClasseName"}, [ItemID] = {Life = 500, sword = 84, axe = 74, club = 79, lookType = 7, vocation = 3, effect = 37, msg = "ClasseName"}, [ItemID] = {Life = 800, sword = 50, axe = 85, club = 14, lookType = 9, vocation = 4, effect = 48, msg = "ClasseName"} } function onUse(cid, item, frompos)
for _, t in ipairs(config) do
end
if t then
if not isInArray(config[t]vocation, getPlayerVocation(cid)) then
local outfit = getCreatureOutfit(cid) outfit.lookType = config[t]lookType doCreatureChangeOutfit(cid, outfit) doPlayerSetVocation(cid, config[t]vocation)
setCreatureMaxHealth(cid, getCreatureMaxHealth(cid) +config[t]Life) doCreatureAddHealth(cid, getCreatureMaxHealth(cid))
for i = 1,50 do
doPlayerAddSkill(cid, IDdaSkill, i)
end
doSendMagicEffect(frompos, config[t]effect) setPlayerStorageValue(cid, 14160, os.time() + cfg.time *60) doPlayerSendTextMessage(cid, 20, "Congratulations! You become a "..config[t]msg.."!") else doPlayerSendCancel(cid, "You are now ready.") return true end end