Ola entao estou trabalhando em um poketibia e gostaria que me ajudasse em um script, eu queria um action que quando clicasse em X item aparecia um mostro e soltava poderes me ajuda por 30 minutos, mais ai o item nao sumia, so poderia usar o pet dnv depois de 24 horas alguem ajuda
function onUse(cid) local monster = { ["Dragon"] = {1, 1800} } local cd = { cdtime = 86400, --//-- quanto tempo fica sem usar o item str = 69872, } tempo = 60000*30 --//-- tempo em segundos que o monstro vai ajudar o player summon = getCreatureSummons(cid) for l, m in pairs(monster) do if getPlayerStorageValue(cid, cd.str) < os.time() and summon then setPlayerStorageValue(cid, cd.str, os.time() + cd.cdtime) doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid))) doCreatureSay(cid, "Go!", 1) doSendMagicEffect(getThingPos(cid), 10) break else return doPlayerSendTextMessage(cid, 25, 'You can not use this item unless you wait..') and doSendMagicEffect(getThingPos(cid), 2) end end for _, monster in ipairs(getCreatureSummons(cid)) do addEvent(doRemoveCreature, tempo, monster) end if summon and getPlayerStorageValue(cid, cd.str) >= os.time() or getPlayerStorageValue(cid, cd.str) < os.time() then for n, p in ipairs(summon) do doRemoveCreature(p) end end return true end
Em 06/02/2019 em 22:22, Kuro o Shiniga disse:function onUse(cid) local monster = { ["Dragon"] = {1, 1800} } local cd = { cdtime = 86400, --//-- quanto tempo fica sem usar o item str = 69872, } tempo = 60000*30 --//-- tempo em segundos que o monstro vai ajudar o player summon = getCreatureSummons(cid) for l, m in pairs(monster) do if getPlayerStorageValue(cid, cd.str) < os.time() and summon then setPlayerStorageValue(cid, cd.str, os.time() + cd.cdtime) doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid))) doCreatureSay(cid, "Go!", 1) doSendMagicEffect(getThingPos(cid), 10) break else return doPlayerSendTextMessage(cid, 25, 'You can not use this item unless you wait..') and doSendMagicEffect(getThingPos(cid), 2) end end for _, monster in ipairs(getCreatureSummons(cid)) do addEvent(doRemoveCreature, tempo, monster) end if summon and getPlayerStorageValue(cid, cd.str) >= os.time() or getPlayerStorageValue(cid, cd.str) < os.time() then for n, p in ipairs(summon) do doRemoveCreature(p) end end return true end
onde eu coloco isso? como que faço funcionar? onde coloco a id do item
1 hora atrás, Fawkzz12 disse:onde eu coloco isso? como que faço funcionar? onde coloco a id do item
<action itemid="id_do_item" script="arquivo.lua"/>
Como deixar ele unique? para que serve o
["Dragon"] = {1, 1800}
51 minutos atrás, Kuro o Shiniga disse:<action itemid="id_do_item" script="arquivo.lua"/>
Oie poderia adaptar ele pra min porfavor do REP + eu queria que quando usase ele, ele atacasse sozinho tipo usando m1, m2, m3 etc sozinho, e tbm poder usar um pokemon quando tiver usando ele, tipo o card do pxg poderia fazer isso?
Em 06/02/2019 em 18:22, Kuro o Shiniga disse:function onUse(cid) local monster = { ["Dragon"] = {1, 1800} } local cd = { cdtime = 86400, --//-- quanto tempo fica sem usar o item str = 69872, } tempo = 60000*30 --//-- tempo em segundos que o monstro vai ajudar o player summon = getCreatureSummons(cid) for l, m in pairs(monster) do if getPlayerStorageValue(cid, cd.str) < os.time() and summon then setPlayerStorageValue(cid, cd.str, os.time() + cd.cdtime) doConvinceCreature(cid, doSummonCreature(l, getCreaturePosition(cid))) doCreatureSay(cid, "Go!", 1) doSendMagicEffect(getThingPos(cid), 10) break else return doPlayerSendTextMessage(cid, 25, 'You can not use this item unless you wait..') and doSendMagicEffect(getThingPos(cid), 2) end end for _, monster in ipairs(getCreatureSummons(cid)) do addEvent(doRemoveCreature, tempo, monster) end if summon and getPlayerStorageValue(cid, cd.str) >= os.time() or getPlayerStorageValue(cid, cd.str) < os.time() then for n, p in ipairs(summon) do doRemoveCreature(p) end end return true end
ta tirando error
[02/10/2019 21:56:17] [Error - Action Interface]
[02/10/2019 21:56:17] data/actions/scripts/Card System/Card Mew.lua:onUse
[02/10/2019 21:56:17] Description:
[02/10/2019 21:56:17] data/actions/scripts/Card System/Card Mew.lua:19: attempt to index global 'item' (a nil value)
[02/10/2019 21:56:17] stack traceback:
[02/10/2019 21:56:17] data/actions/scripts/Card System/Card Mew.lua:19: in function <data/actions/scripts/Card System/Card Mew.lua:1>
Lo soluciono tiene el script?
Em 13/02/2019 em 13:15, Kuro o Shiniga disse:<action itemid="id_do_item" script="arquivo.lua"/>
[07/05/2020 13:53:19] [Error - CreatureScript Interface]
[07/05/2020 13:53:20] data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
[07/05/2020 13:53:20] Description:
[07/05/2020 13:53:20] data/lib/106-main functions.lua:276: attempt to index a number value
[07/05/2020 13:53:20] stack traceback:
[07/05/2020 13:53:20] data/lib/106-main functions.lua:276: in function 'getEffectvineSpell'
[07/05/2020 13:53:20] data/creaturescripts/scripts/player/statsChange.lua:203: in function <data/creaturescripts/scripts/player/statsChange.lua:6>
[07/05/2020 13:53:21] getPokemonType(cid): O pokemon C Scrobat nao tem um tipo efetivo.
[07/05/2020 13:53:21] [Error - CreatureScript Interface]
[07/05/2020 13:53:21] data/creaturescripts/scripts/player/statsChange.lua:onStatsChange
[07/05/2020 13:53:21] Description:
[07/05/2020 13:53:21] data/creaturescripts/scripts/player/statsChange.lua:112: attempt to index a number value
[07/05/2020 13:53:21] stack traceback:
[07/05/2020 13:53:21] data/creaturescripts/scripts/player/statsChange.lua:112: in function <data/creaturescripts/scripts/player/statsChange.lua:6>