Ir para conteúdo

Featured Replies

Postado

Ola amigos, estou começando na area de script e estou quebrando a cabeça para colocar um simples exaust em um script.

 

function onSay(cid, words, param, condition, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
   doTeleportThing(cid, {x=1053, y=1054, z=7})
   doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP")
else
   return doPlayerSendCancel(cid, "Voce nao pode usar o comando agora!")
end
   return true
end

 
Se alguem puder me ajudar ou se ja tiver um tópico relacionado mandar o link porque não encontrei aqui no forum.
 
Obrigado.
 
Rep+

Resolvido por Fir3element

Ir para solução
  • Respostas 5
  • Visualizações 1.7k
  • Created
  • Última resposta

Top Posters In This Topic

Most Popular Posts

  • local tempo = 30 local storage = 94360 function onSay(cid, words, param, condition, channel) if not getCreatureCondition(cid, CONDITION_INFIGHT) then if (getPlayerStorageValue(cid, storage) <= os.

  • Fir3element
    Fir3element

    local tempo = 30 local storage, exhaust = 94360, 5 function onSay(cid, words, param, condition, channel) if not getCreatureCondition(cid, CONDITION_INFIGHT) then if (getPlayerStorageValue(cid, storag

Postado
local tempo = 30
local storage = 94360

function onSay(cid, words, param, condition, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
if (getPlayerStorageValue(cid, storage) <= os.time()) then
   doTeleportThing(cid, {x=1053, y=1054, z=7})
   doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP")
   setPlayerStorageValue(cid, storage, os.time()+exhaust)
else
   doPlayerSendCancel(cid, "Voce so pode usar o comando daqui a "..exhaust.." segundos")
end
end
   return true
end

obs : não testei.

Postado
  • Autor
local tempo = 30
local storage = 94360

function onSay(cid, words, param, condition, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
if (getPlayerStorageValue(cid, storage) <= os.time()) then
   doTeleportThing(cid, {x=1053, y=1054, z=7})
   doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP")
   setPlayerStorageValue(cid, storage, os.time()+exhaust)
else
   doPlayerSendCancel(cid, "Voce so pode usar o comando daqui a "..exhaust.." segundos")
end
end
   return true
end

obs : não testei.

 

 

 

Erro, ele teleporta cp mas não conta exaust e aparece esse erro:

 

[03/07/2014 18:02:06] [Error - TalkAction Interface] 
[03/07/2014 18:02:06] data/talkactions/scripts/teleportcp.lua:onSay
[03/07/2014 18:02:06] Description: 
[03/07/2014 18:02:06] data/talkactions/scripts/teleportcp.lua:9: attempt to perform arithmetic on global 'exhaust' (a nil value)
[03/07/2014 18:02:07] stack traceback:
[03/07/2014 18:02:07] data/talkactions/scripts/teleportcp.lua:9: in function <data/talkactions/scripts/teleportcp.lua:4>

Postado
  • Solução

local tempo = 30
local storage, exhaust = 94360, 5

function onSay(cid, words, param, condition, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
if (getPlayerStorageValue(cid, storage) <= os.time()) then
   doTeleportThing(cid, {x=1053, y=1054, z=7})
   doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP")
   setPlayerStorageValue(cid, storage, os.time()+exhaust)
else
   doPlayerSendCancel(cid, "Voce so pode usar o comando daqui a "..exhaust.." segundos")
end
end
   return true
end
Postado
local tempo = 30
local storage = 94360

function onSay(cid, words, param, condition, channel)
if not getCreatureCondition(cid, CONDITION_INFIGHT) then
if (getPlayerStorageValue(cid, storage) <= os.time()) then
   doTeleportThing(cid, {x=1053, y=1054, z=7})
   doPlayerSendTextMessage(cid,22, "Voce foi teleportado para o CP")
   setPlayerStorageValue(cid, storage, os.time()+tempo)
else
   doPlayerSendCancel(cid, "Voce so pode usar o comando daqui a "..tempo.." segundos")
end
end
   return true
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