Ir para conteúdo

Featured Replies

Postado

 

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

Resolvido por dirso

Ir para solução
  • Respostas 11
  • Visualizações 748
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

Postado
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 por dirso (veja o histórico de edições)

Postado
  • 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
  • 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 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.

Visitante
Responder

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo