Para quem não sabe como funciona o script : Ao dar use em um item writable no caso 1949(configurável),você pode escrever o local que deseja ser teleportado e clicar em OK para ser teleportado para o local,ao ser teleportado o player deve esperar 30 segundos(configurável) para usar novamente o Teleport Scroll.
(Testado em 0.3.6 [8.54] e ultima REV da TFS [9.1])
Exemplo :
Para você ser teleportado para o trainers,basta escrever Trainers e clicar em OK.
Clicando em OK você será teleportado para os trainers e terá que esperar 30 segundos para usar o Teleport Scroll novamente.
• Adicionando o script •
"data/creaturescripts/scripts/tsviiting.lua" :
local t = {
["Temple"] = {pos = {x = 1000, y = 1000, z = 7}, storage = 79402, time = 30},
["Teleports"] = {pos = {x = 2000, y = 2000, z = 7}, storage = 79402, time = 30},
["Trainers"] = {pos = {x = 3000, y = 3000, z = 7}, storage = 79403, time = 30}
}
function onTextEdit(cid, item, newText)
if item.itemid == 1949 then
if isPlayerPzLocked(cid) then
doCreatureSay(cid, "Voce esta com battle!", TALKTYPE_MONSTER)
return false
end
if isInArray({'locations', 'places', 'place'}, newText) then
local i = ''
for text, x in pairs(t) do
i = i .. "\n[" .. text .. "]"
end
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Locais de teleportes: " .. i)
else
local p = t[newText]
if not p then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, "Local invalido")
return false
end
local st = p.storage
if getCreatureStorage(cid, st) > os.time() then
doCreatureSay(cid, "Voce precisa esperar " .. getCreatureStorage(cid, st) - os.time() .. ' segundo(s)' .. (getCreatureStorage(cid, st) - os.time() == 1 and "" or "s") .. " para teleportar novamente.", TALKTYPE_MONSTER)
return true
end
local ti = p.time
local pos = p.pos
doTeleportThing(cid, pos, true)
doSendMagicEffect(pos, CONST_ME_TELEPORT)
doCreatureSetStorage(cid, st, os.time() + ti)
doCreatureSay(cid, "Voce foi teleportado!", TALKTYPE_MONSTER)
end
end
return true
end
"data/creaturescripts/creaturescripts.xml" :
<event type="textedit" name="TSViitinG" event="script" value="tsviiting.lua"/>
"data/creaturescripts/scripts/login.lua" :
registerCreatureEvent(cid, "TSViitinG")
Creditos : J.Dre / Sonik / Fallen / Shinmaru / ViitinG
• Configurando •