Hi all,
I have a NPC Safari Zone (Tibia TFS) doesn't that teleports me to the area Safari zone
This is NPC
Please help me
I think the teleport function is that this bad, it's evolution
which is the tfs?
Regards!:w00t:
REP++
- - - Updated - - -
BUMP
I have a NPC Safari Zone (Tibia TFS) doesn't that teleports me to the area Safari zone
This is NPC
Code:
local zone = {x=2195, y=1797, z=4} --- Posicion que el npc debe llevar al jugador ( la posicion de la entrada a saffari zone ).
local storage = 20000 ---Storage value que entrrgara al player ( debe ser el mismo k las talkactions y movements ).
local steps = 600 ---El número de pasos que el jugador tiene que estar en la zona safari. ( segun tu mapa que le pongas a saffari zone )
local cost = 20 ---Precio por cada paso.
---------------------------------------fin de Configuracion--------------------------------------
local pay = cost * steps ---No Editar
local focus = 0 -- No Editar
local talk_start = 0 -- No Editar
local target = 0 -- No Editar
local following = false -- No Editar
local attacking = false -- No Editar
function getPlayerMoney(cid)
gold = getPlayerItemCount(cid,2148)
plat = getPlayerItemCount(cid,2152)*100
crys = getPlayerItemCount(cid,2160)*10000
money = gold + plat + crys
return money
end
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Adioz, Vuelve pronto.')
focus = 0
talk_start = 0
end
end
function onCreatureTurn(creature)
end
function msgcontains(txt, str)
return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end
function onCreatureSay(cid, type, msg)
msg = string.lower(msg)
if (msgcontains(msg, 'hi') and (focus == 0)) and getDistanceToCreature(cid) < 4 then
selfSay('Hola ' .. getCreatureName(cid) .. '! Yo te puedo llevar a la zona safari.')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Disculpe, ' .. getCreatureName(cid) .. '! Puedo hablar con usted en un minuto.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'safari') then
selfSay('¿Deseas comprar ' .. steps ..' pasos en la saffari zone por ' .. pay ..' GPS?')
talk_state = 1
elseif talk_state == 1 then
if msgcontains(msg, 'yes') then
if getPlayerMoney(cid) >= pay then
setPlayerStorageValue(cid,storage,0)
doTeleportThing(cid, zone)
doSendMagicEffect(zone,10)
doPlayerRemoveMoney(cid,pay)
else
selfSay('No tienes dinero para comprar esa cantidad de pasos.')
end
end
talk_state = 0
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 30 then
if focus > 0 then
selfSay('Siguiente porfabor...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Adioz, vuelve pronto.')
focus = 0
end
end
end
Please help me
I think the teleport function is that this bad, it's evolution
which is the tfs?
Regards!:w00t:
REP++
- - - Updated - - -
BUMP
Last edited: