PO
pedido

Adicionar Exaustion No Talkaction

Por popohat7, 29 de nov. de 2012 em Scripts

10
1.2k
popohat7P
29 de novembro de 2012 às 14:22

Olá, õ/ tudo bem galera ? Alguem pode adicionar um exaustion de 1 min entre um uso e outro ?

 

function onSay(cid, words, param)
local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)
  if isCreature(creature) == TRUE then
  doSendDistanceShoot(pos,getThingPos(creature),38)
  doSendMagicEffect(getThingPos(creature),3)
  doPushCreature(creature,getPlayerLookDir(cid))
  else
  doPlayerSendCancel(cid,"Você precisa selecionar o alvo.")
  end
return TRUE
end

Editado Novembro 29 por SkyDevilFire

OpenyourmindO
29 de novembro de 2012 às 14:36
function onSay(cid, words, param)

if (getPlayerStorageValue(cid, config.s) <= os.time()) then
doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.")
setPlayerStorageValue(cid,config.s,os.time()+config.exhau) return
end

			  local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)
local config = {
s = 11548,
exhaust = 60 -- Tempo de exhaustion
 if isCreature(creature) == TRUE then
  doSendDistanceShoot(pos,getThingPos(creature),38)
  doSendMagicEffect(getThingPos(creature),3)
  doPushCreature(creature,getPlayerLookDir(cid))
  else
  doPlayerSendCancel(cid,"Você precisa selecionar o alvo.")
  end
return TRUE
end

Editado Novembro 29 por Openyourmind

SkyLighS
29 de novembro de 2012 às 14:48

Open onde ta a function que declara o

exhausted

?

 

editei aki pra vc.

 

local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)
local config = {
s = 11548, -- n mexa
exhau = 60 -- quantos segundos de exhaust
}
function onSay(cid, words, param)

if (getPlayerStorageValue(cid, config.s) <= os.time()) then
doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.")
end


 if isCreature(creature) == TRUE then
  setPlayerStorageValue(cid,config.s,os.time()+config.exhau)
doSendDistanceShoot(pos,getThingPos(creature),38)
  doSendMagicEffect(getThingPos(creature),3)
  doPushCreature(creature,getPlayerLookDir(cid))
  else
  doPlayerSendCancel(cid,"Você precisa selecionar o alvo.")
  end
return TRUE
end

Editado Novembro 29 por SkyLigh

caoticC
29 de novembro de 2012 às 15:50

Open onde ta a function que declara o

exhausted

?

 

editei aki pra vc.

 

local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)
local config = {
s = 11548, -- n mexa
exhau = 60 -- quantos segundos de exhaust
}
function onSay(cid, words, param)

if (getPlayerStorageValue(cid, config.s) <= os.time()) then
doPlayerSendCancel(cid, "Você tem que esperar " .. config.exhau .. " segundos para usar novamente.")
setPlayerStorageValue(cid,config.s,os.time()+config.exhau) return
end


 if isCreature(creature) == TRUE then
  doSendDistanceShoot(pos,getThingPos(creature),38)
  doSendMagicEffect(getThingPos(creature),3)
  doPushCreature(creature,getPlayerLookDir(cid))
  else
  doPlayerSendCancel(cid,"Você precisa selecionar o alvo.")
  end
return TRUE
end

 

Ta incorreto.

Você colocou a função na verificação da storage ele sempre ficara com exhastion.

Além de que o return ta ao lado da função.

SkyLighS
29 de novembro de 2012 às 15:52

Arrumado !

popohat7P
29 de novembro de 2012 às 23:56

Skyligh, não funcionou man ... ta dando "voce precisa selecionar o alvo" sendo que o alvo já está selecionado.

 

Na espera,

LuckOakeL
30 de novembro de 2012 às 00:01

Tó:

 

 

function onSay(cid, words, param)
local wait = 60 -- Tempo em segundos
local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)

if exhaustion.check(cid, 3719) then
doPlayerSendCancel(cid, "Aguarde "..exhaustion.get(cid, 3719).." segundos para usar o comando novamente.") return true
elseif creature < 1 then
doPlayerSendCancel(cid,"Você precisa selecionar o alvo.") return true
end

doSendDistanceShoot(pos,getThingPos(creature),38)
doSendMagicEffect(getThingPos(creature),3)
doPushCreature(creature,getPlayerLookDir(cid))
exhaustion.set(cid, 3719, wait)
return true
end

 

Editado Novembro 30 por LuckOake

popohat7P
30 de novembro de 2012 às 00:05

Luck man, não funcionou também... Nada acontece quando usa a talk....

LuckOakeL
30 de novembro de 2012 às 00:09

É que eu tinha feito uma bobeira sem querer. Editei lá.

 

Mas de qualquer forma, já deixo o script aqui também. Tó:

 

 

function onSay(cid, words, param)
local wait = 60 -- Tempo em segundos
local creature = getCreatureTarget(cid)
local pos = getThingPos(cid)

if exhaustion.check(cid, 3719) then
doPlayerSendCancel(cid, "Aguarde "..exhaustion.get(cid, 3719).." segundos para usar o comando novamente.") return true
elseif creature < 1 then
doPlayerSendCancel(cid,"Você precisa selecionar o alvo.") return true
end

doSendDistanceShoot(pos,getThingPos(creature),38)
doSendMagicEffect(getThingPos(creature),3)
doPushCreature(creature,getPlayerLookDir(cid))
exhaustion.set(cid, 3719, wait)
return true
end

 

Editado Novembro 30 por LuckOake

popohat7P
30 de novembro de 2012 às 00:11

Ae, funcionou perfeitamente obrigado luck =) aah, se puder olha meu outro topico que voce post tambem =)

 

Abraços.