Ir para conteúdo

Featured Replies

Postado

function onCastSpell(cid, var)
local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
local waittime = 15 --tempo em segundos
local storage = 2560 --storage do exuast, em cada magia uma storage diferente.

if exhaustion.check(cid, storage) then
   doPlayerSendTextMessage(cid, 23, "Essa magia saira do cooldown em " .. exhaustion.get(cid, storage) .. " segundos.")
return false
end

exhaustion.set(cid, storage, waittime)

local target = getCreatureTarget(cid)
local Hp = (getCreatureHealth(target))*0.2

if isCreature(target) then
doCreatureAddHealth(target, -Hp) -- remove o valor de 20% da vida do jogador
doSendMagicEffect(position1, 269) -- EFEITO DA MAGIA
end
return true
end

Resolvido por luangop

Ir para solução
Postado
  • Solução
function onCastSpell(cid, var)
	local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
	local waittime = 15 --tempo em segundos
	local storage = 2560 --storage do exuast, em cada magia uma storage diferente.
	local target = getCreatureTarget(cid)
	if not isPlayer(target) then
		return doPlayerSendTextMessage(cid, 23, "Essa magia só pode ser usada em players.") and false
	end
	if exhaustion.check(cid, storage) then
		doPlayerSendTextMessage(cid, 23, "Essa magia saira do cooldown em " .. exhaustion.get(cid, storage) .. " segundos.")
		return false
	end
	
	exhaustion.set(cid, storage, waittime)
	
	local Hp = (getCreatureHealth(target))*0.2
	
	if isCreature(target) then
		doCreatureAddHealth(target, -Hp) -- remove o valor de 20% da vida do jogador
		doSendMagicEffect(position1, 269) -- EFEITO DA MAGIA
	end
	return true
end

 

Te ajudei? Clique em  Gostei ! 

²²²d¬¬b²²²

 

 

"She's got a smile that it seems to me...."  ♪♪

Postado
  • Autor
18 horas atrás, luangop disse:

function onCastSpell(cid, var)
	local position1 = {x=getThingPosition(getCreatureTarget(cid)).x+1, y=getThingPosition(getCreatureTarget(cid)).y+1, z=getThingPosition(getCreatureTarget(cid)).z}
	local waittime = 15 --tempo em segundos
	local storage = 2560 --storage do exuast, em cada magia uma storage diferente.
	local target = getCreatureTarget(cid)
	if not isPlayer(target) then
		return doPlayerSendTextMessage(cid, 23, "Essa magia só pode ser usada em players.") and false
	end
	if exhaustion.check(cid, storage) then
		doPlayerSendTextMessage(cid, 23, "Essa magia saira do cooldown em " .. exhaustion.get(cid, storage) .. " segundos.")
		return false
	end
	
	exhaustion.set(cid, storage, waittime)
	
	local Hp = (getCreatureHealth(target))*0.2
	
	if isCreature(target) then
		doCreatureAddHealth(target, -Hp) -- remove o valor de 20% da vida do jogador
		doSendMagicEffect(position1, 269) -- EFEITO DA MAGIA
	end
	return true
end

 

Vllw meu parceiro, resolveu meus problemas!!

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.

Conteúdo Similar

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.6k

Informação Importante

Confirmação de Termo