Postado Setembro 11, 2018 6 anos Alguém poderia me ajudar a fazer com que essa action cure meu summon invocado: local summons = getCreatureSummons(cid) if getPlayerStorageValue(cid, 8001) == 0 then local hpAdd = math.random(10, 15) if getCreatureSummons(cid) then doCreatureAddHealth(summons, getCreatureMaxHealth(cid) * (hpAdd / 100)) doSendAnimatedText(getThingPos(summons), "+" .. hpAdd .. "%", TEXTCOLOR_RED) doSendMagicEffect(getCreaturePosition(summons), CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, 4789, tempo + os.time()) return true end end
Postado Setembro 13, 2018 6 anos Spoiler local summons = getCreatureSummons(cid) --if getPlayerStorageValue(cid, 8001) == 0 then local hpAdd = math.random(10, 15) / 100 if getCreatureSummons(cid) then doCreatureAddHealth(summons, getCreatureMaxHealth(cid) * (hpAdd)) doSendAnimatedText(getThingPos(summons), "+" .. hpAdd .. "%", TEXTCOLOR_RED) doSendMagicEffect(getCreaturePosition(summons), CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, 4789, tempo + os.time()) return true end --end Try this Editado Setembro 13, 2018 6 anos por dirso (veja o histórico de edições)
Postado Setembro 13, 2018 6 anos Autor deu esses erros @dirso Spoiler [13/9/2018 11:17:13] [Error - Action Interface] [13/9/2018 11:17:13] data/actions/scripts/healthangels.lua:onUse [13/9/2018 11:17:13] Description: [13/9/2018 11:17:13] (LuaInterface::luaDoCreatureAddHealth) Creature not found [13/9/2018 11:17:14] [Error - Action Interface] [13/9/2018 11:17:14] data/actions/scripts/healthangels.lua:onUse [13/9/2018 11:17:14] Description: [13/9/2018 11:17:14] (LuaInterface::luaGetThingPosition) Thing not found [13/9/2018 11:17:14] [Error - Action Interface] [13/9/2018 11:17:14] data/actions/scripts/healthangels.lua:onUse [13/9/2018 11:17:14] Description: [13/9/2018 11:17:14] (LuaInterface::luaGetThingPosition) Thing not found
Postado Setembro 14, 2018 6 anos Solução Spoiler function onUse(cid) local summons = getCreatureSummons(cid) if summons then local hpAdd = math.random(10, 15) / 100 for i=1, #summons do doCreatureAddHealth(summons[i], getCreatureMaxHealth(cid) * hpAdd) doSendAnimatedText(getThingPos(summons[i]), "+" .. hpAdd .. "%", TEXTCOLOR_RED) doSendMagicEffect(getCreaturePosition(summons[i]), CONST_ME_MAGIC_BLUE) doRemoveItem(item.uid, 1) setPlayerStorageValue(cid, 4789, tempo + os.time()) end return true end return false end Editado Setembro 14, 2018 6 anos por dirso Redefinição da função com Loop (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.