Ir para conteúdo

Featured Replies

Postado

Pessoal Gostaria de um script que quando equipa-se um "X" item ele ficasse subindo o EFEITO com a palavra (DONATE) e quando tirasse esse "X" item ele parasse de subir o efeito com a palavra (DONATE).

 

 

Se puder ajudar; vale REP+ !

Resolvido por nookia

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

Top Posters In This Topic

Most Popular Posts

  • Não testei. local cfg = {     delay = 2 -- Segundos     msg = "DONATE!" -- Menssagem     items = {2463}, -- Items que irão enviar a menssagem } local function doSendTxt(cid, txt)     if getPlayerSt

  • local config = { tempo = 2, msg = "DONATE!", items = {2463} -- Itens que vai enviar a msg. } local function doSendText(cid, text) if (isPlayer(cid) == FALSE) then return false end if ge

Postado

Não testei.

local cfg = {
    delay = 2 -- Segundos
    msg = "DONATE!" -- Menssagem
    items = {2463}, -- Items que irão enviar a menssagem
}

local function doSendTxt(cid, txt)
    if getPlayerStorageValue(cid, 12992) < 1 then
        return true
    end
        
    doSendAnimatedText(getThingPos(Cid), txt, math.random(1, 255))
    doSendMagicEffect(getThingPos(cid), 10)
    return addEvent(doSendTxt, cfg.delay * 1000, cid, txt)
end

function onEquip(cid, item)
    if isInArray(cfg.items, item.itemid) then
        if getPlayerStorageValue(cid, 12992) < 1 then
            
            setPlayerStorageValue(cid, 12992, 1)
            doSendText(cid, cfg.msg)
        end
    end
    return true
end

function onDeEquip(cid, item)
    if isInArray(cfg.items, item.itemid) then
        
        setPlayerStorageValue(cid, 12992, 0)
    end
    return true
end

TAG:

<movevent type="Equip" itemid="2463" slot="body" event="script" value="NomeDoScript.lua"/>
<movevent type="DeEquip" itemid="2463" slot="body" event="script" value="NomedoScript.lua"/>

Bom.. pra editar, é o seguinte. Se você for adicionar mais items no slot body, basta fazer assim

modo -> itemid="2463; NewID"
 
exemplo -> itemid="2463; 2466"

Caso for adicionar outro slot, voce precisa adicionar outra tag, e mudar o SLOT.

Editado por Orochi Elf (veja o histórico de edições)

Tony Araújo  ;D 

 

Postado
  • Autor

 

 

Então mano , valeu por tentar ajudar, mais só que deu só esse error:
 
 
[Error - LuaScriptInterface::loadFile] data/movements/scripts/king.lua:3: '}' expected (to close '{' at line 1) near 'msg'
[20/11/2014 17:07:48] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/king.lua)
[20/11/2014 17:07:48] data/movements/scripts/king.lua:3: '}' expected (to close '{' at line 1) near 'msg'
[20/11/2014 17:07:48] [Error - LuaScriptInterface::loadFile] data/movements/scripts/king.lua:3: '}' msg (to close '{' at line 1) near 'msg'
[20/11/2014 17:07:48] [Warning - Event::loadScript] Cannot load script (data/movements/scripts/king.lua)
[20/11/2014 17:07:48] data/movements/scripts/king.lua:3: '}' expected (to close '{' at line 1) near 'msg'
Postado
  • Solução
local config = {
    tempo = 2,
    msg = "DONATE!",
    items = {2463} -- Itens que vai enviar a msg.
}

local function doSendText(cid, text)

if (isPlayer(cid) == FALSE) then
return false
end

if getPlayerStorageValue(cid, 19234) < 1 then
return TRUE
end

doSendAnimatedText(getPlayerPosition(cid),config.msg, math.random(01,255))
return addEvent(doSendText, config.tempo * 1000, cid, text)
end

function onEquip(cid, item)
if isInArray(config.items, item.itemid) then
if getPlayerStorageValue(cid, 19234) < 1 then
setPlayerStorageValue(cid, 19234, 1)
doSendText(cid, config.msg)
end
end
return TRUE
end

function onDeEquip(cid, item)
if isInArray(config.items, item.itemid) then
setPlayerStorageValue(cid, 19234, 0)
end
return TRUE
end

Testei e ta funcionando.

The medieval RpG Server

espada-barbara.jpg

[RpG] OLDWORLD OPEN TIBIA

Postado
  • Diretor

 

Não testei.

local cfg = {
    delay = 2 -- Segundos
    msg = "DONATE!" -- Menssagem
    items = {2463}, -- Items que irão enviar a menssagem
}

local function doSendTxt(cid, txt)
    if getPlayerStorageValue(cid, 12992) < 1 then
        return true
    end
        
    doSendAnimatedText(getThingPos(Cid), txt, math.random(1, 255))
    doSendMagicEffect(getThingPos(cid), 10)
    return addEvent(doSendTxt, cfg.delay * 1000, cid, txt)
end

function onEquip(cid, item)
    if isInArray(cfg.items, item.itemid) then
        if getPlayerStorageValue(cid, 12992) < 1 then
            
            setPlayerStorageValue(cid, 12992, 1)
            doSendText(cid, cfg.msg)
        end
    end
    return true
end

function onDeEquip(cid, item)
    if isInArray(cfg.items, item.itemid) then
        
        setPlayerStorageValue(cid, 12992, 0)
    end
    return true
end

TAG:

<movevent type="Equip" itemid="2463" slot="body" event="script" value="NomeDoScript.lua"/>
<movevent type="DeEquip" itemid="2463" slot="body" event="script" value="NomedoScript.lua"/>

Bom.. pra editar, é o seguinte. Se você for adicionar mais items no slot body, basta fazer assim

modo -> itemid="2463; NewID"
 
exemplo -> itemid="2463; 2466"

Caso for adicionar outro slot, voce precisa adicionar outra tag, e mudar o SLOT.

 

tá errado >> local cfg = {

 

20230912_034613.png.cf49b650c34dd7d7b1f79bd49c70f53c.png

Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código.  #OpenSource #Programação #Contribuição

 

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.6k

Informação Importante

Confirmação de Termo