Teste a função porque fiz correndo ._. Só colocar o nome do NPC em 'name'.
function doRemoveNpcByName(name) -- Byerne XTibia return (isCreature(getCreatureByName(name)) and not isPlayer(getCreatureByName(name))) and doRemoveCreature(getCreatureByName(name)) or false end
O bloco completo ficaria assim:
function doRemoveNpcByName(name) -- Byerne XTibia
return (isCreature(getCreatureByName(name)) and not isPlayer(getCreatureByName(name))) and doRemoveCreature(getCreatureByName(name)) or false
end
elseif msgcontains(msg, 'coin') then
if getPlayerStorageValue(cid, 6007) == -1 then
doPlayerAddItem(cid,2160,100)
selfSay('As you wish.', cid)
doRemoveNpcByName("Shenron")
setGlobalStorageValue(6010, -1)
setGlobalStorageValue(1999, -1)
setPlayerStorageValue(cid, 6007, 1)
else
selfSay("I can't do this wish for you.", cid)
end



info
Group: Visconde
Joined: 15/02/11
Posts: 259
Reputation: +25
Tibia Character: Aias Laf Du
Tenho um NPC que da um premio quando o player leva um item.
ao dar o item o NPC deve ser removido,
encontrei um NPC que tinha este comando.
nao funcionava. nem executava o comando.
entao deixei assim
da um erro mais ou menos assim, "attempt global" sei la o que, "executeCommand"
queria algo que substituise esta função
segui um pedaço do script
elseif msgcontains(msg, 'coin') and getPlayerStorageValue(cid, 6007) == -1 then doPlayerAddItem(cid,2160,100) selfSay('Thanks for you wish.') executeCommand(cid, "/r", "Shenron") setGlobalStorageValue(6010, -1) setGlobalStorageValue(1999, -1) setPlayerStorageValue(cid, 6007, 1) elseif msgcontains(msg, 'coin') and getPlayerStorageValue(cid, 6007) == 1 then selfSay("I can't do this wish for you.")