poste os scripts deles .
ddemon.lua
fighter.lua
reb1.lua
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

poste os scripts deles .
ddemon.lua
fighter.lua
reb1.lua
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Me ajuda em 1 apenas q eu faço com os outros, rsrs.
Ta ae o do fighter:
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
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') then
selfSay('Hey Do you have 20 dino eye for me?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,6021) == 1 then
selfSay('Sorry You Cant Do this quest.')
elseif msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,6543,20) == 0 then
selfSay('Sorry Dont have that items.')
else
if doPlayerAddItem(cid,2395,1) then
setPlayerStorageValue(cid,6021,1)
selfSay('Thanks take this')
focus = 0
talk_start = 0
end
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onThink()
doNpcSetCreatureFocus(focus)
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

.
local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false
function onThingMove(creature, thing, oldpos, oldstackpos)
end
function onCreatureAppear(creature)
end
function onCreatureDisappear(cid, pos)
if focus == cid then
selfSay('Good bye then.')
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') then
selfSay('Hey Do you have 20 dino eye for me?')
focus = cid
talk_start = os.clock()
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Sorry, ' .. getCreatureName(cid) .. '! I talk to you in a minute.')
elseif focus == cid then
talk_start = os.clock()
if msgcontains(msg, 'yes') then
if getPlayerStorageValue(cid,6021) == 1 then
selfSay('Sorry You Cant Do this quest.')
elseif msgcontains(msg, 'yes') then
if doPlayerRemoveItem(cid,6543,20) == 0 then
selfSay('Sorry Dont have that items.')
else
if doPlayerAddItem(cid,2395,1) then
setPlayerStorageValue(cid,6021,1)
selfSay('Thanks take this')
focus = 0
talk_start = 0
end
end
end
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Good bye, ' .. getCreatureName(cid) .. '!')
focus = 0
talk_start = 0
end
end
end
function onThink()
if (os.clock() - talk_start) > 45 then
if focus > 0 then
selfSay('Next Please...')
end
focus = 0
end
if focus ~= 0 then
if getDistanceToCreature(focus) > 5 then
selfSay('Good bye then.')
focus = 0
end
end
end
veja agr
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

To tentando resolver sozinho entao pode me dizer quais alterações vc fez?
Seria melhor para eu aprender
info
Grupo: Lorde
Registrado: 22/07/12
Posts: 2.2k
Reputação: +453
Char no Tibia: Kissy

Havia um erro em uma linha eu so dei uma alterada . nela
que eu creio que podera funcionar se querer me passe eles por pm os outros
que eu veja neles tbm .
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Ok, vou lhe passar
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

o erro em si eh q tu n tem a funçao.. ;x
doNpcSetCreatureFocus(focus)
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

o erro em si eh q tu n tem a funçao.. ;x
doNpcSetCreatureFocus(focus)
Como eu adicionaria?
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

ve se tem isso..
doNpcSetCreatureFocus = selfFocus
em npc/lib/npc.lua
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44

Nao tem cara...
-- get the distance to a creature
function getDistanceToCreature(id)
if id == 0 or id == nil then
selfGotoIdle()
end
cx, cy, cz = creatureGetPosition(id)
if cx == nil then
return nil
end
sx, sy, sz = selfGetPosition()
return math.max(math.abs(sx-cx), math.abs(sy-cy))
end
-- do one step to reach position
function moveToPosition(x,y,z)
selfMoveTo(x, y, z)
end
-- do one step to reach creature
function moveToCreature(id)
if id == 0 or id == nil then
selfGotoIdle()
end
tx,ty,tz=creatureGetPosition(id)
if tx == nil then
selfGotoIdle()
else
moveToPosition(tx, ty, tz)
end
end
-- stop talking
function selfGotoIdle()
following = false
attacking = false
selfAttackCreature(0)
target = 0
end
-- getCount function by Jiddo
function getCount(msg)
b, e = string.find(msg, "%d+")
if b == nil or e == nil then
count = 1
else
count = tonumber(string.sub(msg, b, e))
end
if count > 2000 then
count = 2000
end
return count
end
-- buy an item
function buy(cid, itemid, count, cost)
cost = count*cost
amount = count
if doPlayerRemoveMoney(cid, cost) == 1 then
if getItemStackable(itemid) then
while count > 100 do
doPlayerAddItem(cid, itemid, 100)
count = count - 100
end
doPlayerAddItem(cid, itemid, count) -- add the last items, if there is left
else
while count > 0 do
doPlayerAddItem(cid, itemid, 1)
count = count - 1
end
end
if amount <= 1 then
selfSay('Here is your '.. getItemName(itemid) .. '!')
else
selfSay('Here are your '.. amount ..' '.. getItemName(itemid) .. 's!')
end
else
selfSay('Sorry, you do not have enough money.')
end
end
function buyFluidContainer(cid, itemid, count, cost, fluidtype)
cost = count*cost
amount = count
if doPlayerRemoveMoney(cid, cost) == 1 then
while count > 0 do
doPlayerAddItem(cid, itemid, fluidtype)
count = count - 1
end
if amount <= 1 then
selfSay('Here is your '.. getItemName(itemid) .. '!')
else
selfSay('Here are your '.. amount ..' '.. getItemName(itemid) .. 's!')
end
else
selfSay('Sorry, you do not have enough money.')
end
end
-- sell an item
function sell(cid, itemid, count, cost)
cost = count*cost
if doPlayerRemoveItem(cid, itemid, count) == 1 then
coins = math.floor(cost/10000)
crystals = coins
while coins > 100 do
doPlayerAddItem(cid, 2160, 100)
coins = coins - 100
end
doPlayerAddItem(cid, 2160, coins)
cost = cost - crystals*10000
coins = math.floor(cost/100)
if coins > 0 then
doPlayerAddItem(cid, 2152, coins)
cost = cost - coins*100
end
coins = cost
if cost > 0 and cost < 100 then
doPlayerAddItem(cid, 2148, coins)
cost = cost - coins
end
if cost > 0 then
selfSay('You couldn\'t retrieve '.. cost ..' gold pieces, please contact the admin.')
end
if count <= 1 then
selfSay('Thanks for this '.. getItemName(itemid) .. '!')
else
selfSay('Thanks for these '.. count..' '.. getItemName(itemid) .. 's!')
end
else
selfSay('Sorry, you do not have this item.')
end
end
-- pay for anything?
function pay(cid, cost)
if doPlayerRemoveMoney(cid, cost) == 1 then
return true
else
return false
end
end
-- Travel player
function travel(cid, x, y, z)
destpos = {x = x, y = y, z = z}
doTeleportThing(cid, destpos)
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
info
Grupo: Príncipe
Registrado: 19/08/10
Posts: 4k
Reputação: +1.1k
Gênero: Masculino

hã... entao adiciona ae em qlqr lugar.. ;x
e q versao de serv tas usando ![]()
info
Grupo: Conde
Registrado: 13/12/11
Posts: 619
Reputação: +44