Ir para conteúdo
  • 0

[Npc] Npc Teleporter Por Storage


romeu23

Pergunta

Posts Recomendados

  • 0

Hm tente esse

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid)  npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg)  npcHandler:onCreatureSay(cid, type, msg) end
function onThink()  npcHandler:onThink() end

function oracle(cid, message, keywords, parameters, node)
if(not npcHandler:isFocused(cid)) then
return false
end

local cityNode = node:getParent():getParent()
local vocNode = node:getParent()

local destination = cityNode:getParameters().destination
local town = cityNode:getParameters().town
local vocation = vocNode:getParameters().vocation

if(destination ~= nil and vocation ~= nil and town ~= nil) then
if(getPlayerStorage(cid) =  7714 then
npcHandler:say('Only permited players ' .. parameters.level .. '!', cid)
else
doPlayerSetStorage(cid, storage)
doPlayerSetTown(cid, town)
else
doTeleportThing(cid, destination)
Setdestination(cid, storage) = town = 1, destination = {x=469, y=172, z=7}
doSendMagicEffect(destination, CONST_ME_MAGIC_BLUE)
end
	end
end
npcHandler:resetNpc()
return true
end

function greetCallback(cid)
if(getPlayerLevel(cid) < 8) then
npcHandler:say('COME BACK WHEN YOU GROW UP, CHILD!')
return false
else
return true
end
end

Link para o comentário
Compartilhar em outros sites

  • 0

function onUse(cid, storage, fromPosition, toPosition)

local teleport = {x=100, y=54, z=7} -- Coordenadas para onde o player irá ser teleportado.
local Storage_id = 2195 -- ID do item que o player precisa para ser teleportado.

if getPlayerStorage(cid,Storage_id) == 2195 then
	doTeleportThing(cid, teleport)
	doSendMagicEffect(getPlayerPosition(cid), 10)
	doPlayerSendTextMessage(cid, 22, "Ok, let's go! You are permision  for make this teleport!")
	else
	doPlayerSendTextMessage(cid, 23, "Sorry, you need a permission to enter")
	end
end

 

.-. TENTA DNV até nos conseguirmos.

 

esse é diferente ;-; vc coloca isso na pasta actions/scripts/arquivo.lua

 

dai dps vc coloca em actions.xml

 

<action actionid="2195" event="script" value="arquivo.lua"/>

 

dai tipo vai no rme escolhe uma estatua e coloca o actionid nela

dai ela vai teleporta quando tiver item.

Editado por HarpiaLOOK
Link para o comentário
Compartilhar em outros sites

  • 0

Se nao for agora n posso mas ajudar.

 

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
local pos = {x=160,y=54,z=7}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if (not npcHandler:isFocused(cid)) then
return false
end
if msgcontains(msg, "") or msgcontains(msg, "help") then
talkState[cid] = 0
elseif msgcontains(msg, '') then
selfSay("Good luck in war!", cid)
doTeleportThing(cid, pos)
end
if getPlayerStorageValue(cid,7714) <= TRUE then
if getPlayerStorageValue(cid,7715) <= TRUE then
Say("Sorry, but your guild does not have access to a private area of war.", cid)
end
return true
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...