Postado Abril 13, 2018 7 anos E ae Galera, Estou com problema em uma Baú que da algumas coisas ao abrir, da o seguinte erro: A script que uso é essa: function onUse(cid, item, frompos, item2, topos) local vocs = { [1] = {{2190,1}}, [2] = {{2182,1}}, [3] = {{2410,5}}, [4] = {{2379,1}}, } local var = vocs[getPlayerVocation(cid)] if not var then return true end if getPlayerStorageValue(cid, storage) > 0 then doPlayerSendTextMessage(cid,22,"It is empty.") return true end for _, i_i in ipairs(var) do local item, amount = i_i[1],i_i[2] if isItemStackable(item) or amount == 1 then doPlayerAddItem(item, amount) else end end local expReward = 90 if item.uid == 1001 then queststatus = getPlayerStorageValue(cid,1001) if queststatus == -1 then if getPlayerLevel(cid) >= 1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Voce ainda nao pode abrir esse bau.") end else doPlayerSendTextMessage(cid,22,"Esta vazio.") end else return 1 end return 1 end Se alguem souber como arrumar agradeço, Desde já Grato!OBS: Não quero apenas um Baú que de itens por classe, quero que de a EXP e os itens. So queria que desse a arma por classe. @Edit 14/04/2018Já consegui podem fechar o tópico, caso alguém queira a script esta ai: function onUse(cid, item, frompos, item2, topos) local expReward = 90 voc = getPlayerVocation(cid) queststatus = getPlayerStorageValue(cid,1001) if voc == 1 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2190,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 2 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2182,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 3 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2410,5) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end elseif voc == 4 then if queststatus == -1 then doPlayerSendTextMessage(cid,22,"Parabens, voce encontrou alguns itens!") doPlayerAddItem(cid,2650,1) doPlayerAddItem(cid,2379,1) doPlayerAddItem(cid,2512,1) doPlayerAddItem(cid,2649,1) doPlayerAddItem(cid,2461,1) doPlayerAddItem(cid,2554,1) doPlayerAddItem(cid,2120,1) doPlayerAddExp(cid, expReward) doPlayerSendTextMessage(cid, 22, 'Voce ganhou '.. expReward ..' de experiencia.') setPlayerStorageValue(cid,1001,1) else doPlayerSendTextMessage(cid,22,"Esta vazio.") end else return 0 end return 1 end Editado Abril 14, 2018 7 anos por peterson18 (veja o histórico de edições)
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.