faz uma verificaçao usando IsNpc(uid)
info
Grupo: Infante
Registrado: 04/03/11
Posts: 1.6k
Reputação: +393
Char no Tibia: No Have

info
Grupo: Lenda
Registrado: 03/10/06
Posts: 2.6k
Reputação: +309
Gênero: Masculino
Char no Tibia: Knight Orion

Fez? Então poste aqui pra que todos possam usar!
info
Grupo: Barão
Registrado: 12/09/10
Posts: 249
Reputação: +53

Então pessoal eu pedi esse script porque ele é muito útil para tutores, pois alguns tutores abusam dando goto pra npcs de quest , e etc.
Eu usei o script padrão, apenas removendo a parte que voce pode dar goto em npc ou em determinada coordenada.
Vá no talkactions.xml e coloque:
<talkaction log="yes" words="/got" access="1" event="script" value="got.lua" /> <talkaction log="yes" words="/ccc" access="1" event="script" value="puxando.lua" />
Lembrando que você pode editar o nome do comando a seu gosto. No caso ali o "/got" é um /goto só que ele nao funciona em npc. E o /ccc é o comando de "puxar" só que não puxa npcs.
Nos scripts crie um arquivo got.lua e cole:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local creature = getCreatureByName(param)
local player = getPlayerByNameWildcard(param)
local waypoint = getWaypointPosition(param)
local tile = string.explode(param, ",")
local pos = {x = 0, y = 0, z = 0}
if(player ~= nil and (not isPlayerGhost(player) or getPlayerGhostAccess(player) <= getPlayerGhostAccess(cid))) then
pos = getCreaturePosition(player)
else
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Invalid param specified.")
return true
end
local tmp = getCreaturePosition(cid)
if(doTeleportThing(cid, pos, true) and not isPlayerGhost(cid)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
return true
end
Depois crie um arquivo chamado puxando.lua e cole:
function onSay(cid, words, param, channel)
if(param == '') then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command requires param.")
return true
end
local target = getPlayerByNameWildcard(param)
if(not target) then
target = getPlayerByName(param)
if(not target) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
return true
end
end
if(isPlayerGhost(target) and getPlayerGhostAccess(target) > getPlayerGhostAccess(cid)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Creature not found.")
return true
end
local pos = getClosestFreeTile(target, getCreaturePosition(cid), false, false)
if(not pos or isInArray({pos.x, pos.y}, 0)) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Cannot perform action.")
return true
end
local tmp = getCreaturePosition(target)
if(doTeleportThing(target, pos, true) and not isPlayerGhost(target)) then
doSendMagicEffect(tmp, CONST_ME_POFF)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
end
return true
end
É isso ai pessoal, espero que ajude a todos.
Editado Junho 8 por dragonfight



info
Grupo: Barão
Registrado: 12/09/10
Posts: 249
Reputação: +53
Olá Pessoal, preciso de um comando goto que nao funcione em npc, que somente de pra dar goto em players.
Aguardo ajuda
Ja fiz o script, pode fechar
Editado Junho 7 por dragonfight