Postado Fevereiro 20, 2017 8 anos Autor Citar function onUse(cid, item, frompos, item2, topos) if item.uid == 8945 then local queststatus = getPlayerStorageValue(cid, 31320) local max_gold = 50 if queststatus == -1 then local qtd_gold = math.random(1,50) doPlayerSendTextMessage(cid,22,"Parabéns você acabou de completar a reflect quest e recebeu ".. qtd_gold .." golds em uma quantidade aleatória de 0 a ".. max_gold ..". ") setPlayerStorageValue(cid, 45455, 1) doPlayerAddItem(cid, 2160, qtd_gold) setPlayerStorageValue(cid, queststatus, 1) else doPlayerSendTextMessage(cid,22,"Está vazio.") end end return true end Correto? Eu mudei o id do gold só, mas ainda ta dando pra pegar mais de uma vez.
Postado Fevereiro 20, 2017 8 anos 4 minutos atrás, diarmaint disse: Correto? Eu mudei o id do gold só, mas ainda ta dando pra pegar mais de uma vez. Correto. Estranho estar podendo pegar mais de uma vez. Pode postar alguma outra quest do server? Pra ver a diferença
Postado Fevereiro 20, 2017 8 anos Autor Serve? Citar function onUse(cid, item, fromPosition, itemEx, toPosition) if item.uid > 1000 and item.uid < 13000 then local itemWeight = getItemWeightById(item.uid, 1) local playerCap = getPlayerFreeCap(cid) if getPlayerStorageValue(cid, item.uid) == -1 then if playerCap >= itemWeight then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. '.') doPlayerAddItem(cid, item.uid ,1) setPlayerStorageValue(cid, item.uid, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'You have found a ' .. getItemNameById(item.uid) .. ' weighing ' .. itemWeight .. ' oz it\'s too heavy.') end else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "It is empty.") end else return false end return true end
Postado Fevereiro 20, 2017 8 anos Script: Spoiler function onUse(cid, item, fromPosition, itemEx, toPosition) local l = { storage = 45455, -- storage desejada storage2 = 1234, -- storage da quest, para não fazer novamente gmax = 50, -- quantidade máxima de golds que vai poder ganhar gold = 2160, -- Item Id do Gold random = math.random(1, gmax) } if getPlayerStorageValue(cid, l.storage2) == -1 then doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Parabéns você acabou de completar a Reflect Quest e recebeu ' .. l.random .. ' golds.') doPlayerAddItem(cid, l.gold, l.random) setPlayerStorageValue(cid, l.storage, 1) setPlayerStorageValue(cid, l.storage2, 1) else doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, 'Você já terminou a quest!') end return true end tag xml: <action actionid="4000" event="script" value="NomeDoArquivo.lua"/> @Tópico movido para área correta, preste mais atenção da próxima vez!!
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.