Postado Fevereiro 13, 2017 8 anos Em 15/06/2014 ás 17:14, xWhiteWolf disse: 1) itemport.lua: local config = { storage = 49607, tempo = 10, itemid = 6217 } local positions = {} function onCastSpell(cid, var) if getPlayerStorageValue(cid, config.storage) <= 0 then table.insert(positions, getThingPos(cid)) doPlayerSetStorageValue(cid, config.storage, #positions) doCreateItem(config.itemid, getThingPos(cid)) doSendMagicEffect(getThingPos(cid), 3) addEvent(function() if isCreature(cid) then doPlayerSendTextMessage(cid, 22, "Your item has expired.") doPlayerSetStorageValue(cid, config.storage, 0) table.remove(positions, getPlayerStorageValue(cid, config.storage)) end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doTeleportThing(cid, positions[getPlayerStorageValue(cid, config.storage)]) doSendMagicEffect(getThingPos(cid), 10) end return true end 2) playerport.lua local config = { storage = 49608, tempo = 10 } function onCastSpell(cid, var) if isPlayer(getCreatureTarget(cid)) then local name = getCreatureName(getCreatureTarget(cid)) if getPlayerStorageValue(cid, config.storage) <= 0 then doPlayerSetStorageValue(cid, config.storage, 1) doSendMagicEffect(getThingPos(cid), 65) doSendMagicEffect(getThingPos(getCreatureByName(name)), 65) addEvent(function() if isCreature(cid) then doPlayerSetStorageValue(cid, config.storage, 0) doTeleportThing(cid, getThingPos(getCreatureByName(name))) end end, 1000*config.tempo) elseif getPlayerStorageValue (cid, config.storage) > 0 then doSendMagicEffect(getThingPos(cid), 2) doPlayerSendCancel(cid, "You've already set your target.") end else doPlayerSendCancel (cid, "You can only use this spell on players.") end return true end e no spells.xml: <instant name="TK SUPORT" words="itemport" lvl="50" mana="100" prem="1" exhaustion="1000" needlearn="0" event="script" value="especiais/itemport.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> <instant name="TK SUPORT" words="playerport" lvl="50" mana="100" prem="1" range="7" needtarget="1" blockwalls="1" exhaustion="1000" needlearn="0" event="script" value="especiais/playerport.lua"> <vocation id="5"/> <vocation id="6"/> <vocation id="7"/> <vocation id="8"/> </instant> agora vá em creaturescripts\scripts\login.lua e adicione essas linhas antes do ultimo return true if getPlayerStorageValue(cid, 49607) == -1 then setPlayerStorageValue(cid, 49607, 0) end if getPlayerStorageValue(cid, 49608) ~= 0 then setPlayerStorageValue(cid, 49608, 0) end Tenho uma grande duvida como eu faço para o item sumir quando expirado ?? Editado Fevereiro 13, 2017 8 anos por David Otserver (veja o histórico de edições)
Postado Fevereiro 13, 2017 8 anos 3 horas atrás, David Otserver disse: Tenho uma grande duvida como eu faço para o item sumir quando expirado ?? só botar decay no items.xml. São duas linhas (o tempo que demora em segundos pro item sofrer decay e pra qual id vc vai transformar ele.. pra ele sumir é só botar 0 no id)
Postado Fevereiro 18, 2017 8 anos Em 13/02/2017 ás 07:32, xWhiteWolf disse: só botar decay no items.xml. São duas linhas (o tempo que demora em segundos pro item sofrer decay e pra qual id vc vai transformar ele.. pra ele sumir é só botar 0 no id) Não consegui pode me explicar melhor?
Postado Fevereiro 20, 2017 8 anos procura o id do item no itens.xml e adiciona essas duas linhas aqui: <attribute key="decayTo" value="0" /> <attribute key="duration" value="10" />
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.