Ir para conteúdo
  • 0

Verificação De Full Mana E Health


Mattziin

Pergunta

Eu Preciso de ajuda nesse script aqui, Esse script aki é um talkactions que quando tu fala "aumenta" Sobe 800 de life e de mana , eu queria q bota-se a função de parar de encher quando tivesse full a mana e a life e tambem um doPlayerSendCancel falando q esta full ! vlw

 

 

local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}	
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
  return false
  end
  if tb_rot[n] == false then
  doCreatureAddHealth(cid, heals['hp'])
  doCreatureAddMana(cid, heals['mana'])
  doSendMagicEffect(getCreaturePosition(cid), 3)
  addEvent(rot, interval,cid,2,old)
  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
	 if isInArray(cid) == TRUE then
		return FALSE
	 end
	 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

	 return FALSE
end

Link para o comentário
Compartilhar em outros sites

Posts Recomendados

  • 0

título irregular

reportado

 

vo editar aki jaja eu posto

 

Script

 

local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}	  
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
	  return false
  end
  if tb_rot[n] == false then
	  doCreatureAddHealth(cid, heals['hp'])
	  doCreatureAddMana(cid, heals['mana'])
	  doSendMagicEffect(getCreaturePosition(cid), 3)
	  addEvent(rot, interval,cid,2,old)
	  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
			 if isInArray(cid) == TRUE then
					return FALSE
			 end
			 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

			 return FALSE
end		  
if getCreatureMaxHealth(cid) and getPlayerMaxMana(cid) then
doPlayerSendTextMessage(cid, 22 , "Desculpe mais sua mana ja esta full")
end	  

Editado por SkyLigh
Link para o comentário
Compartilhar em outros sites

  • 0

Amigo por favor leia nossas regras antes de postar.

Seu titulo esta irregular, segundo nossas regras o titulo precisa ser diretamente direcionado ao assunto do tópico.

Link para o comentário
Compartilhar em outros sites

  • 0

título irregular

reportado

 

vo editar aki jaja eu posto

 

Script

 

local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}	  
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
	  return false
  end
  if tb_rot[n] == false then
	  doCreatureAddHealth(cid, heals['hp'])
	  doCreatureAddMana(cid, heals['mana'])
	  doSendMagicEffect(getCreaturePosition(cid), 3)
	  addEvent(rot, interval,cid,2,old)
	  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
			 if isInArray(cid) == TRUE then
					return FALSE
			 end
			 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

			 return FALSE
end		  
if getCreatureMaxHealth(cid) and getPlayerMaxMana(cid) then
doPlayerSendTextMessage(cid, 22 , "Desculpe mais sua mana ja esta full")
end	  

 

Lek nao funfou nao , continua a encher e nao para quando fica full :S

Link para o comentário
Compartilhar em outros sites

  • 0
local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}	   
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
	  return false
  end
  if tb_rot[n] == false then
	  doCreatureAddHealth(cid, heals['hp'])
	  doCreatureAddMana(cid, heals['mana'])
	  doSendMagicEffect(getCreaturePosition(cid), 3)
	  addEvent(rot, interval,cid,2,old)
	  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
			 if isInArray(cid) == TRUE then
				    return FALSE
			 end
			 if getPlayerMana(cid) == getPlayerMaxMana(cid) and getCreatureHealth(cid) == getCreatureMaxHealth(cid)then
			 doPlayerSendCancel(cid,"Your life and mana full")
			 end
			 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

			 return FALSE
end

Link para o comentário
Compartilhar em outros sites

  • 0

ver assim

 

local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}		 
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
			  return false
  end
  if tb_rot[n] == false then
			  doCreatureAddHealth(cid, heals['hp'])
			  doCreatureAddMana(cid, heals['mana'])
			  doSendMagicEffect(getCreaturePosition(cid), 3)
			  addEvent(rot, interval,cid,2,old)
			  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
							 if isInArray(cid) == TRUE then
									    return FALSE
							 end
							 if getPlayerMaxMana(cid) and getCreatureHealth(cid) == getCreatureMaxHealth(cid)then
							 doPlayerSendCancel(cid,"Your life and mana full")
							 end
							 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

							 return FALSE
end

Link para o comentário
Compartilhar em outros sites

  • 0
local interval = 0
local heals = {
['hp'] = 800,
['mana'] = 800,
}
----
local interval = 1000
local function rot(cid,n,old)
  local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}		 
  if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then
			  return false
  end
  if tb_rot[n] == false then
			  doCreatureAddHealth(cid, heals['hp'])
			  doCreatureAddMana(cid, heals['mana'])
			  doSendMagicEffect(getCreaturePosition(cid), 3)
			  addEvent(rot, interval,cid,2,old)
			  return false
  end
  n = n+1
  addEvent(rot, interval,cid,n,old)
end
function onSay(cid, words, param)
							 if isInArray(cid) == TRUE then
									    return FALSE
							 end
							 if getPlayerMaxMana(cid) == getPlayerMana(cid) and getCreatureMaxHealth(cid) == getCreatureHealth(cid)then
							 doPlayerSendCancel(cid,"Your life and mana full")
							 end
							 addEvent(rot, interval,cid,1,getCreaturePosition(cid))

							 return FALSE
end

Link para o comentário
Compartilhar em outros sites

  • 0

 

local interval = 0

local heals = {

['hp'] = 800,

['mana'] = 800,

}

local php = getCreatureHealth(cid)

local mhp = getPlayerMana(cid)

 

----

local interval = 1000

local function rot(cid,n,old)

local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}

if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then

return false

end

 

if tb_rot[n] == false then

repeat

doCreatureAddHealth(cid, heals['hp'])

doCreatureAddMana(cid, heals['mana'])

doSendMagicEffect(getCreaturePosition(cid), 3)

addEvent(rot, interval,cid,2,old)

until getCreatureHealth(cid) == php and getPlayerMana(cid) == mhp

doPlayerSendCancel(cid, "Life e mana completos.")

return false

end

n = n+1

addEvent(rot, interval,cid,n,old)

end

 

function onSay(cid, words, param)

if isInArray(cid) == TRUE then

return FALSE

end

addEvent(rot, interval,cid,1,getCreaturePosition(cid))

return FALSE

end

 

 

Tó.

Link para o comentário
Compartilhar em outros sites

  • 0

kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk, agora o distro trava kk e aparece esse erro.

[29/08/2012 20:25:38] [Error - TalkAction Interface]

[29/08/2012 20:25:38] data/talkactions/scripts/aumenta.lua

[29/08/2012 20:25:38] Description:

[29/08/2012 20:25:38] (luaGetCreatureMana) Creature not found

 

[29/08/2012 20:27:55] [Error - TalkAction Interface]

[29/08/2012 20:27:55] In a timer event called from:

[29/08/2012 20:27:55] data/talkactions/scripts/aumenta.lua:onSay

[29/08/2012 20:27:55] Description:

[29/08/2012 20:27:55] not enough memory

 

e o ot trava kkkk

Editado por Mattziin
Link para o comentário
Compartilhar em outros sites

  • 0

Foi mal, fiz besteira.

 

 

local interval = 0

local heals = {

['hp'] = 800,

['mana'] = 800,

}

local php = getCreatureMaxHealth(cid)

local mhp = getCreatureMaxMana(cid)

 

----

local interval = 1000

local function rot(cid,n,old)

local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}

if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then

return false

end

 

if tb_rot[n] == false then

repeat

doCreatureAddHealth(cid, heals['hp'])

doSendMagicEffect(getCreaturePosition(cid), 3)

addEvent(rot, interval,cid,2,old)

until getCreatureHealth(cid) == php

doPlayerSendCancel(cid, "Life completo.")

repeat

doCreatureAddMana(cid, heals['mana'])

doSendMagicEffect(getCreaturePosition(cid), 3)

addEvent(rot, interval,cid,2,old)

until getCreatureHealth(cid) == mhp

doPlayerSendCancel(cid, "Mana completa.")

return false

end

n = n+1

addEvent(rot, interval,cid,n,old)

end

 

function onSay(cid, words, param)

if isInArray(cid) == TRUE then

return FALSE

end

addEvent(rot, interval,cid,1,getCreaturePosition(cid))

return FALSE

end

 

 

Tó. PS: Talvez eu fiz besteira de novo, mas como eu to fazendo testes para aprender loops, qualquer coisa eu mudo.

Editado por LuckOake
Link para o comentário
Compartilhar em outros sites

  • 0

@SkyLigh

 

Tá, já percebemos que não funciona. Mas ao invés de simplesmente falar que não funciona, me corrija.

 

@Topic

 

Tenta assim:

 

 

local interval = 0

local heals = {

['hp'] = 800,

['mana'] = 800,

}

local php = getCreatureMaxHealth(cid)

local mhp = getCreatureMaxMana(cid)

 

----

local interval = 1000

local function rot(cid,n,old)

local tb_rot = {{0,2},{6,5},{1,3},{7,4},false}

if isPlayer(cid) == FALSE or tb_rot[n] == nil or old.x ~= getCreaturePosition(cid).x or old.y ~= getCreaturePosition(cid).y then

return false

end

 

if tb_rot[n] == false then

while getCreatureHealth(cid) ~= php and getCreatureMana(cid) ~= mhp do

doCreatureAddHealth(cid, heals['hp'])

doCreatureAddMana(cid, heals['mana'])

doSendMagicEffect(getCreaturePosition(cid), 3)

addEvent(rot, interval,cid,2,old)

end

doPlayerSendCancel(cid, "Life e Mana completos.")

return false

end

n = n+1

addEvent(rot, interval,cid,n,old)

end

 

function onSay(cid, words, param)

if isInArray(cid) == TRUE then

return FALSE

end

addEvent(rot, interval,cid,1,getCreaturePosition(cid))

return FALSE

end

 

Editado por LuckOake
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...