Postado Fevereiro 17, 2020 5 anos Solução @maleskinho de boa, usa a mesma TAG que te passei e no código assim: function onUse(cid, item, fromPosition, itemEx, toPosition) local minutes = 2 local rand = math.random(1, 100) if item.itemid ~= 11253 then return true end if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.") doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getThingfromPos(toPosition).uid, 11253) end, minutes*60000) return true end
Postado Fevereiro 17, 2020 5 anos Autor Em 17/02/2020 em 01:21, Vodkart disse: @maleskinho de boa, usa a mesma TAG que te passei e no código assim: function onUse(cid, item, fromPosition, itemEx, toPosition) local minutes = 2 local rand = math.random(1, 100) if item.itemid ~= 11253 then return true end if getPlayerStorageValue(cid, 45490) <= 0 then doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") return true end if rand > 25 then doCreateMonster("guzzlemaw", getCreaturePosition(cid)) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts.") doSendMagicEffect(toPosition, CONST_ME_MAGIC_RED) else setPlayerStorageValue(cid, 45491, getPlayerStorageValue(cid, 45491)+1) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(toPosition, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getThingfromPos(toPosition).uid, 11253) end, minutes*60000) return true end Funcionou, consegue adicionar o texto pra 2 min? ai finalizou haha
Postado Fevereiro 17, 2020 5 anos @maleskinho como assim? o texto aparecer para o jogador que clicou depois de 2 minutos? não entendi man usa assim if item.itemid ~= 11253 then doCreatureSay(cid, "Wait 2 minutes to use a pile.", TALKTYPE_ORANGE_1, false, 0, getCreaturePosition(cid)) return true end
Postado Fevereiro 17, 2020 5 anos Que bom que resolveu, só consegui vim posta agora mas editei o seu mesmo quiser testa também. function onUse(cid, item, frompos, item2, topos) local StorageExaust = 722404 -- Mude Aqui caso queira trocar a storage. local Time = 120 -- Valores em segundos que ele terá que esperar. local pos = getThingPos(item.uid) if getPlayerStorageValue(cid, StorageExaust) > os.time() then doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true end local rand = math.random(1, 100) if item.itemid == 11253 and item.actionid == 45492 then if getPlayerStorageValue(cid, 45490) <= 0 then return doPlayerSendCancel(cid, "Speak with Sandomo to use this item.") else if rand > 25 then doTransformItem(item.uid, 12688) doDecayItem(item.uid) addEvent(function() item2 = getThingfromPos(pos) doTransformItem(item2.uid,11253) end, 2*60*1000) doCreateMonster("guzzlemaw", getCreaturePosition(cid), false, true); doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts."); doSendMagicEffect(topos, CONST_ME_MAGIC_RED) setPlayerStorageValue(cid, StorageExaust, os.time() + Time) else doTransformItem(item.uid, 12688) doDecayItem(item.uid) addEvent(function() item2 = getThingfromPos(pos) doTransformItem(item2.uid,11253) end, 2*60*1000) local stor = getPlayerStorageValue(cid, 45491) + 1 setPlayerStorageValue(cid, 45491, stor) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Amidst the pile of various bones you find a large, hollow part, similar to a pipe."); doSendMagicEffect(topos, CONST_ME_MAGIC_GREEN) setPlayerStorageValue(cid, StorageExaust, os.time() + Time) end end elseif item.itemid == 12688 and item.actionid == 45492 then return doCreatureSay(cid, "Wait 2 minutes to use a pile.", TALKTYPE_ORANGE_1, false, 0, getCreaturePosition(cid)) end return true end
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.