Postado Fevereiro 16, 2020 5 anos @maleskinho testa assim: 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 rand = math.random(1, 100) if item.itemid == 12688 and item.actionid == 45492 then if getPlayerStorageValue(cid, StorageExaust) > os.time() then doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true end end if item.itemid == 11253 and item.actionid == 45492 then 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), false, true) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts."); doSendMagicEffect(topos, 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(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) doDecayItem(item.uid) setPlayerStorageValue(cid, StorageExaust, os.time() + Time) end return true end
Postado Fevereiro 16, 2020 5 anos Autor Em 16/02/2020 em 22:32, Vodkart disse: @maleskinho testa assim: 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 rand = math.random(1, 100) if item.itemid == 12688 and item.actionid == 45492 then if getPlayerStorageValue(cid, StorageExaust) > os.time() then doPlayerSendCancel(cid, "Você não pode usar este item agora.") return true end end if item.itemid == 11253 and item.actionid == 45492 then 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), false, true) doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You ransack the pile but fail to find any useful parts."); doSendMagicEffect(topos, 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(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) doDecayItem(item.uid) setPlayerStorageValue(cid, StorageExaust, os.time() + Time) end return true end só diz a msg "you cannot use this object" sem erros na distro.
Postado Fevereiro 17, 2020 5 anos @maleskinho Deve ser porque quando vira o item 12688 ele perde o actionID. o certo é fazer no proprio script, depois de 2 minutos, voltar a ser o item de antes; @maleskinho faz assim: function onUse(cid, item, frompos, item2, topos) local minutes = 2 local rand = math.random(1, 100) local pos = {x = 138, y = 52, z=7} -- position do item 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(topos, 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(topos, CONST_ME_MAGIC_GREEN) end doTransformItem(item.uid, 12688) addEvent(function() doTransformItem(getTileItemById(pos, 12688).uid, 11253) end, minutes*60000) return true end
Postado Fevereiro 17, 2020 5 anos Autor Em 17/02/2020 em 00:06, Vodkart disse: @maleskinho Deve ser porque quando vira o item 12688 ele perde o actionID. o certo é fazer no proprio script, depois de 2 minutos, voltar a ser o item de antes; Deixei o script normal, coloquei a id 11253 pra ficar depois que clicar, mas ai eu consigo clicar toda hora sem parar. ;s
Postado Fevereiro 17, 2020 5 anos @maleskinho eu fiz um novo código ai em cima, testa ele. até pq só funciona se for o item 11253
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.