LO

erro aloot

Por lol08, 01 de mai. de 2015 em Archived

script
7
1.2k
lol08L
01 de maio de 2015 às 19:06
[01/05/2015 22:05:07] [Error - CreatureScript Interface]

[01/05/2015 22:05:07] In a timer event called from:

[01/05/2015 22:05:07] data/creaturescripts/scripts/aloot.lua:onKill

[01/05/2015 22:05:07] Description:

[01/05/2015 22:05:07] data/lib/050-function.lua:234: attempt to index a boolean value

[01/05/2015 22:05:07] stack traceback:

[01/05/2015 22:05:07] data/lib/050-function.lua:234: in function 'getItemName'

[01/05/2015 22:05:07] data/creaturescripts/scripts/aloot.lua:57: in function <data/creaturescripts/scripts/aloot.lua:8>

ZetrosZ
01 de maio de 2015 às 19:25

Poste esse script aqui
data/creaturescripts/scripts/aloot.lua

lol08L
01 de maio de 2015 às 19:36
function onLogin(cid)

registerCreatureEvent(cid, "aloot_kill")

return true

end


local stor = 7575


function autoloot(cid, target, pos)

local function doStack(cid, itemid, new)

local count = getPlayerItemCount(cid, itemid)

if (count > 100) then

count = count - math.floor(count / 100) * 100

end

local newCount = count + new

if (count ~= 0) then

local find = getPlayerItemById(cid, true, itemid, count).uid

if (find > 0) then

doRemoveItem(find)

else

newCount = new

end

end

local item = doCreateItemEx(itemid, newCount)

doPlayerAddItemEx(cid, item, true)

end


local function scanContainer(cid, uid, list)

for k = (getContainerSize(uid) - 1), 0, -1 do

local tmp = getContainerItem(uid, k)

if (isInArray(list, tmp.itemid)) then

if isItemStackable(tmp.itemid) and (getPlayerItemCount(cid, tmp.itemid) > 0) then

doStack(cid, tmp.itemid, tmp.type)

else

local item = doCreateItemEx(tmp.itemid, tmp.type)

doPlayerAddItemEx(cid, item, true)

end

doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Looted ' .. tmp.type .. ' ' .. getItemNameById(tmp.itemid) .. '.')

doRemoveItem(tmp.uid)

elseif isContainer(tmp.uid) then

scanContainer(cid, tmp.uid, list)

end

end

end


local items = {}

for i = getTileInfo(pos).items, 1, -1 do

pos.stackpos = i

table.insert(items, getThingFromPos(pos))

end


if (#items == 0) then

return

end


local corpse = -1

for _, item in ipairs(items) do

local name = getItemName(item.uid):lower()

if name:find(target:lower()) then

corpse = item.uid

break

end

end


if (corpse ~= -1) and isContainer(corpse) then

scanContainer(cid, corpse, tostring(getPlayerStorageValue(cid, stor)):gsub('_', ''):explode(','))

end

end


function onKill(cid, target, lastHit)

if not isPlayer(target) then

local infos = getPlayerStorageValue(cid, stor)

if (infos == -1) then

return true

end

local list = tostring(infos):explode(',')

if (#list == 0) then

return true

end

addEvent(autoloot, 150, cid, getCreatureName(target), getCreaturePosition(target))

end

return true

end

Editado Maio 1 por lol08

david0703D
01 de maio de 2015 às 19:41

Tentei resolver esse problema do auto-loot nativo do PDA [base cyan] e não tive sucesso...

Tive que criar outro a partir do 0

Show Off

lol08L
01 de maio de 2015 às 19:43

poxa mais esse seu ai cata tudo e tem uns players dizendo que ele clona stone

david0703D
03 de maio de 2015 às 07:01

O que eu fiz não clona...

Não podem falar sobre meu script pq não disponibilizei ele...

Apenas um servidor tem [Pokeforce] a versão 1.0

Editado Maio 3 por david0703

2 meses depois...
BrunoB
14 de julho de 2015 às 17:57

O tópico foi fechado e movido para lixeira por estar inativo a mais de 10 dias. Caso seja preciso reabrir o mesmo, favor entrar em contato com a equipe.