Ir para conteúdo

(Resolvido)[Ajuda] Colocar pausa de tempo entre os laços do for

Featured Replies

Postado
elseif spell == "Leech Seed" then
	setPlayerStorageValue(cid, 498587, 1)
	for var = 1,10 do
		addEvent(function()
			if not target then return false end
			if getPlayerStorageValue(cid, 498587) == 1 then
				local life = getCreatureHealth(target)
				local newlife = life - getCreatureHealth(target)
				doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1)
				doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
				doSendMagicEffect(getThingPosWithDebug(cid), 12)
				doSendMagicEffect(getThingPosWithDebug(target), 45)
				if newlife >= 1 then
					doCreatureAddHealth(cid, newlife)
					doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
				end 
			end
		end, 1000*var)
	end 
  • Respostas 11
  • Visualizações 461
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • elseif spell == "Leech Seed" then setPlayerStorageValue(cid, 498587, 1) for var = 1,10 do addEvent(function() if not isCreature(target) or not isCreature(cid) then return false end if getPla

Postado
  • Autor

Fica aparecendo attempt to perform arithmetic on local 'life' (a boolean value)
Quando o target morre. Aparece no log o numero de vezes que falta pra terminar o for.



 tumblr_mwfeg45FIV1qk4cb3o4_500.gif

Postado
elseif spell == "Leech Seed" then
	setPlayerStorageValue(cid, 498587, 1)
	for var = 1,10 do
		addEvent(function()
			if not isCreature(target) or not isCreature(cid) then return false end
			if getPlayerStorageValue(cid, 498587) == 1 then
				local life = getCreatureHealth(target)
				doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1)
				doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
				doSendMagicEffect(getThingPosWithDebug(cid), 12)
				doSendMagicEffect(getThingPosWithDebug(target), 45)
				local newlife = life - getCreatureHealth(target)
				if newlife >= 1 then
					doCreatureAddHealth(cid, newlife)
					doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
				end 
			end
		end, 1000*var)
	end 
Postado

Bom... Se não for agora, vou passar ter que deixar outra pessoa resolver.

elseif spell == "Leech Seed" then
	setPlayerStorageValue(cid, 498587, 1)
	for var = 1,10 do
		addEvent(function()
			if not isCreature(target) or not isCreature(cid) then return false end
			if getPlayerStorageValue(cid, 498587) == 1 then
				local life = getCreatureHealth(target)
				doSendDistanceShoot(getThingPosWithDebug(cid), getThingPosWithDebug(target), 1)
				doSendMagicEffect(getThingPosWithDebug(cid), 12)
				doSendMagicEffect(getThingPosWithDebug(target), 45)
				doAreaCombatHealth(cid, GRASSDAMAGE, getThingPosWithDebug(target), 0, -min, -max, 14)
				local newlife = isCreature(target) and (life - getCreatureHealth(target)) or 0
				if newlife >= 1 then
					doCreatureAddHealth(cid, newlife)
					doSendAnimatedText(getThingPosWithDebug(cid), "+"..newlife.."", 32)
				end 
			end
		end, 1000*var)
	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.

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.7k

Informação Importante

Confirmação de Termo