Cara não consegue-se entender nada com sua pergunta, explique o que deseja, p/ que deseja, onde vai usar...
Aguardando...
Cara não consegue-se entender nada com sua pergunta, explique o que deseja, p/ que deseja, onde vai usar...
Aguardando...
putz agora que vi, realmente não fez sentido o q falei desculpe. hauhuahua
Vou tentar explicar:
Tem um NPC que dá 2 items ao jogador, um deles é um RING, e o teleporta para uma area X que é isolada.
Quando o player quiser sair desta area clicará no ring e será teletransportado e os 2 items são removidos (tanto o anel quanto o outro item que ganhou do npc).
Porem preciso que se o player morrer os itens tambem sejam removidos.
---
segue o script do anel (action script)
function onUse(cid, item, frompos, item2, topos)
local config = {
pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no").
battle = "yes", -- players deve estar sem battle ("yes" or "no")
pos = {x=1052, y=1488, z=7}
}
if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")
return TRUE
end
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Precisa estar fora de batalha para teleportar.")
return TRUE
end
if item.itemid == 2208 then <--- id do anel
doPlayerSendTextMessage(cid,22,"Você foi teletransportado e seus items foram removidos!")
doPlayerRemoveItem(cid, 2644, 1) <--- outro item que sera removido
doPlayerRemoveItem(cid, 2208, 1) <--- anel que sera removido
doTeleportThing(cid,config.pos)
doSendMagicEffect(getCreaturePosition(cid), 10)
doSendMagicEffect(frompos,6)
end
return 1
end
Editado Agosto 20 por TeruN
1 - Crie um arquivo LUA na sua pasta creaturescripts/scripts de nome itemremove, adicione este conteúdo ao arquivo:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
for _, item in pairs({2644, 2208}) do
if getPlayerItemCount(cid, item) > 0 then
doPlayerRemoveItem(cid, item, 1)
end
end
return true
end
2 - Adicione essa linha ao seu creaturescripts.xml:
<event type="death" name="itemremove" script="itemremove.lua"/>
3 - E essa linha ao seu login.lua, localizado no creaturescripts/scripts.
registerCreatureEvent(cid, "itemremove")
Editado Agosto 21 por xotservx
Obrigado pela atenção, a ideia é basicamente essa mesmo!
edit:
Não deu muito certo.
eu morro e os items não somem...
esqueci de citar, mas um dos items é de quantidade. ele vai gastando eles e tem que remover a quantidade que estiver restando no momento que o player morre,
(porem para testar deixar só 1 mas mesmo assim morrendo não dá certo.
para funcionar o do anel, não consegui fazer de outro jeito tive de deixar assim o script:
(tem outra maneira de fazer?)
function onUse(cid, item, frompos, item2, topos)
local config = {
pz = "no", -- players precisam estar em protection zone para usar? ("yes" or "no").
battle = "yes", -- players deve estar sem battle ("yes" or "no")
pos = {x=1052, y=1488, z=7}
}
if(config.pz == "yes") and (getTilePzInfo(getCreaturePosition(cid)) == FALSE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT,"você precisa estar em protection zone pra poder teleportar.")
return TRUE
end
if(config.battle == "yes") and (getCreatureCondition(cid, CONDITION_INFIGHT) == TRUE) then
doPlayerSendTextMessage(cid, MESSAGE_EVENT_DEFAULT, "Precisa estar fora de batalha para teleportar.")
return TRUE
end
if item.itemid == 2208 then <--- id do anel
doPlayerSendTextMessage(cid,22,"Você foi teletransportado e seus items foram removidos!")
doPlayerRemoveItem(cid, 2644, 100)
doPlayerRemoveItem(cid, 2644, 99)
doPlayerRemoveItem(cid, 2644, 98)
doPlayerRemoveItem(cid, 2644, 97)
doPlayerRemoveItem(cid, 2644, 96)
doPlayerRemoveItem(cid, 2644, 95)
doPlayerRemoveItem(cid, 2644, 94)
doPlayerRemoveItem(cid, 2644, 93)
doPlayerRemoveItem(cid, 2644, 92)
doPlayerRemoveItem(cid, 2644, 91)
doPlayerRemoveItem(cid, 2644, 90)
doPlayerRemoveItem(cid, 2644, 89)
doPlayerRemoveItem(cid, 2644, 88)
doPlayerRemoveItem(cid, 2644, 87)
doPlayerRemoveItem(cid, 2644, 86)
doPlayerRemoveItem(cid, 2644, 85)
doPlayerRemoveItem(cid, 2644, 84)
doPlayerRemoveItem(cid, 2644, 83)
doPlayerRemoveItem(cid, 2644, 82)
doPlayerRemoveItem(cid, 2644, 81)
doPlayerRemoveItem(cid, 2644, 80)
doPlayerRemoveItem(cid, 2644, 79)
doPlayerRemoveItem(cid, 2644, 78)
doPlayerRemoveItem(cid, 2644, 77)
doPlayerRemoveItem(cid, 2644, 76)
doPlayerRemoveItem(cid, 2644, 75)
doPlayerRemoveItem(cid, 2644, 74)
doPlayerRemoveItem(cid, 2644, 73)
doPlayerRemoveItem(cid, 2644, 72)
doPlayerRemoveItem(cid, 2644, 71)
doPlayerRemoveItem(cid, 2644, 70)
doPlayerRemoveItem(cid, 2644, 69)
doPlayerRemoveItem(cid, 2644, 68)
doPlayerRemoveItem(cid, 2644, 67)
doPlayerRemoveItem(cid, 2644, 66)
doPlayerRemoveItem(cid, 2644, 65)
doPlayerRemoveItem(cid, 2644, 64)
doPlayerRemoveItem(cid, 2644, 63)
doPlayerRemoveItem(cid, 2644, 62)
doPlayerRemoveItem(cid, 2644, 61)
doPlayerRemoveItem(cid, 2644, 60)
doPlayerRemoveItem(cid, 2644, 59)
doPlayerRemoveItem(cid, 2644, 58)
doPlayerRemoveItem(cid, 2644, 57)
doPlayerRemoveItem(cid, 2644, 56)
doPlayerRemoveItem(cid, 2644, 55)
doPlayerRemoveItem(cid, 2644, 54)
doPlayerRemoveItem(cid, 2644, 53)
doPlayerRemoveItem(cid, 2644, 52)
doPlayerRemoveItem(cid, 2644, 51)
doPlayerRemoveItem(cid, 2644, 50)
doPlayerRemoveItem(cid, 2644, 49)
doPlayerRemoveItem(cid, 2644, 48)
doPlayerRemoveItem(cid, 2644, 47)
doPlayerRemoveItem(cid, 2644, 46)
doPlayerRemoveItem(cid, 2644, 45)
doPlayerRemoveItem(cid, 2644, 44)
doPlayerRemoveItem(cid, 2644, 43)
doPlayerRemoveItem(cid, 2644, 42)
doPlayerRemoveItem(cid, 2644, 41)
doPlayerRemoveItem(cid, 2644, 40)
doPlayerRemoveItem(cid, 2644, 39)
doPlayerRemoveItem(cid, 2644, 38)
doPlayerRemoveItem(cid, 2644, 37)
doPlayerRemoveItem(cid, 2644, 36)
doPlayerRemoveItem(cid, 2644, 35)
doPlayerRemoveItem(cid, 2644, 34)
doPlayerRemoveItem(cid, 2644, 33)
doPlayerRemoveItem(cid, 2644, 32)
doPlayerRemoveItem(cid, 2644, 31)
doPlayerRemoveItem(cid, 2644, 30)
doPlayerRemoveItem(cid, 2644, 29)
doPlayerRemoveItem(cid, 2644, 28)
doPlayerRemoveItem(cid, 2644, 27)
doPlayerRemoveItem(cid, 2644, 26)
doPlayerRemoveItem(cid, 2644, 25)
doPlayerRemoveItem(cid, 2644, 24)
doPlayerRemoveItem(cid, 2644, 23)
doPlayerRemoveItem(cid, 2644, 22)
doPlayerRemoveItem(cid, 2644, 21)
doPlayerRemoveItem(cid, 2644, 20)
doPlayerRemoveItem(cid, 2644, 19)
doPlayerRemoveItem(cid, 2644, 18)
doPlayerRemoveItem(cid, 2644, 17)
doPlayerRemoveItem(cid, 2644, 16)
doPlayerRemoveItem(cid, 2644, 15)
doPlayerRemoveItem(cid, 2644, 14)
doPlayerRemoveItem(cid, 2644, 13)
doPlayerRemoveItem(cid, 2644, 12)
doPlayerRemoveItem(cid, 2644, 11)
doPlayerRemoveItem(cid, 2644, 10)
doPlayerRemoveItem(cid, 2644, 9)
doPlayerRemoveItem(cid, 2644, 8)
doPlayerRemoveItem(cid, 2644, 7)
doPlayerRemoveItem(cid, 2644, 6)
doPlayerRemoveItem(cid, 2644, 5)
doPlayerRemoveItem(cid, 2644, 4)
doPlayerRemoveItem(cid, 2644, 3)
doPlayerRemoveItem(cid, 2644, 2)
doPlayerRemoveItem(cid, 2644, 1)
doPlayerRemoveItem(cid, 2208, 1)
doTeleportThing(cid,config.pos)
doSendMagicEffect(getCreaturePosition(cid), 10)
doSendMagicEffect(frompos,6)
end
return 1
end
Editado Agosto 25 por TeruN
info
Grupo: Campones
Registrado: 12/02/08
Posts: 23
Reputação: +1
Preciso de um script, que ao morrer um item X
seja removido do player
brigadao!