Ir para conteúdo
Banner com Efeitos

Featured Replies

Postado
  • Autor
Em 13/05/2021 em 16:47, Toruk disse:

function Exclusive(cid)
	if isCreature(cid) then
		doSendMagicEffect (getThingPos(cid), config.effect)
		doPlayerSendTextMessage (cid, 27, "Mode Exclusive")
		addEvent(Exclusive, 1*3000)
	end
end

function onUse(cid, item, frompos, item2, topos)
    local config = {
    timeExhausted = 1, -- tempo em horas para poder usar o item novamente.
    timeForUse = 1, -- tempo em horas que o player poderá entrar na cave.
    exhausted = 456789,
    storage = 23575,
    toKnow = 123456,
    effect = 53, -- efeito que dará ao usar o item.
    }
    
    if getPlayerStorageValue(cid, config.exhausted) < os.time() then
        setPlayerStorageValue (cid, config.storage, config.timeForUse * 60 * 60 + os.time())
        setPlayerStorageValue (cid, config.exhausted, config.timeExhausted * 60 * 60 + os.time())
       	doRemoveItem(item.uid,1)
        addEvent(doRemoveCreature, 1*1000, cid, true)
        addEvent(doRemoveCreature, 1*1000, cid, true)
        addEvent(Exclusive, 1000, cid)
        setPlayerStorageValue (cid, config.toKnow, 1)
    else
        doPlayerSendTextMessage (cid, 27, "Mode Exclusive")
    end
return true
end

 

Não mexo muito com tfs mais baixos, mas acho q isso resolve o problema. (Não estava linkando o player pelo addEvent)

[5:51:20.869] [Error - Action Interface]
[5:51:20.872] In a timer event called from:
[5:51:20.874] data/actions/scripts/PotionsEXP/Potion-EXP2X.lua:onUse
[5:51:20.875] Description:
[5:51:20.875] data/actions/scripts/PotionsEXP/Potion-EXP2X.lua:3: attempt to index global 'config' (a nil value)
[5:51:20.876] stack traceback:
[5:51:20.876]   data/actions/scripts/PotionsEXP/Potion-EXP2X.lua:3: in function <data/actions/scripts/PotionsEXP/Potion-EXP2X.lua:1>

  • Respostas 6
  • Visualizações 575
  • Created
  • Última resposta

Top Posters In This Topic

Posted Images

Postado
local config = {
    timeExhausted = 1, -- tempo em horas para poder usar o item novamente.
    timeForUse = 1, -- tempo em horas que o player poderá entrar na cave.
    exhausted = 456789,
    storage = 23575,
    toKnow = 123456,
    effect = 53, -- efeito que dará ao usar o item.
}
	
function Exclusive(cid)
	if isCreature(cid) then
		doSendMagicEffect (getThingPos(cid), config.effect)
		doPlayerSendTextMessage (cid, 27, "Mode Exclusive")
		addEvent(Exclusive, 1*3000)
	end
end

function onUse(cid, item, frompos, item2, topos)
    if getPlayerStorageValue(cid, config.exhausted) < os.time() then
        setPlayerStorageValue (cid, config.storage, config.timeForUse * 60 * 60 + os.time())
        setPlayerStorageValue (cid, config.exhausted, config.timeExhausted * 60 * 60 + os.time())
       	doRemoveItem(item.uid,1)
        addEvent(doRemoveCreature, 1*1000, cid, true)
        addEvent(doRemoveCreature, 1*1000, cid, true)
        addEvent(Exclusive, 1000, cid)
        setPlayerStorageValue (cid, config.toKnow, 1)
    else
        doPlayerSendTextMessage (cid, 27, "Mode Exclusive")
    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