Postado Novembro 20, 2014 10 anos 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+ !
Postado Novembro 20, 2014 10 anos 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 Novembro 20, 2014 10 anos por Orochi Elf (veja o histórico de edições)
Postado Novembro 20, 2014 10 anos 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 Novembro 20, 2014 10 anos 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.
Postado Novembro 20, 2014 10 anos 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 = {
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.