MA
pedido

Verificação De Full Mana E Health

Por Mattziin, 29 de ago. de 2012 em Scripts

script
27
2.7k
MattziinM
29 de agosto de 2012 às 15:50

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

SkyLighS
29 de agosto de 2012 às 18:49

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 Agosto 29 por SkyLigh

caoticC
29 de agosto de 2012 às 18:53

Titulo Renomeado mais atenção na proxima vez

ErimythE
29 de agosto de 2012 às 18:57

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.

MattziinM
29 de agosto de 2012 às 19:22

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

MulizeuM
29 de agosto de 2012 às 19:25
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

MattziinM
29 de agosto de 2012 às 19:57

mulizeu , agora ele diz "mana e life full " mais nao para de encher a mana e a life

SkyLighS
29 de agosto de 2012 às 20:02

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

MulizeuM
29 de agosto de 2012 às 20:06
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

MattziinM
29 de agosto de 2012 às 20:15

Mesma coisa , ele continua encher

LuckOakeL
29 de agosto de 2012 às 20:23

 

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

MattziinM
29 de agosto de 2012 às 20:28

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 Agosto 29 por Mattziin

LuckOakeL
29 de agosto de 2012 às 20:34

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 Agosto 29 por LuckOake

MattziinM
29 de agosto de 2012 às 20:37

kkk mesma coisa lek o ot trava

SkyLighS
29 de agosto de 2012 às 20:38

Luck o script continua sem funcionar so de vista

 

da pra perceber