data/talkactions/scripts/aloot.lua
e na talkaction esse ai é o creaturescript
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

data/talkactions/scripts/aloot.lua
e na talkaction esse ai é o creaturescript
info
Grupo: Conde
Registrado: 30/04/11
Posts: 658
Reputação: +71
Gênero: Masculino
Char no Tibia: ExTibiano

data/talkactions/scripts/aloot.lua
e na talkaction esse ai é o creaturescript
tendi nada mano vc poderia ser mais claro por favor?
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

o erro n esta nesse script que tu posto, esta no data/talkactions/scripts/aloot.lua
posteo para que possamos resolver o problema
info
Grupo: Conde
Registrado: 30/04/11
Posts: 658
Reputação: +71
Gênero: Masculino
Char no Tibia: ExTibiano

o erro n esta nesse script que tu posto, esta no data/talkactions/scripts/aloot.lua
posteo para que possamos resolver o problema
looooooooool foi msmo man postei o script errado ... thx corrigi já vlw!
info
Grupo: Conde
Registrado: 30/10/11
Posts: 625
Reputação: +101
Gênero: Masculino

no script tem umas tag que deve te bugado no topico da onde vc pego,acho que tirei todas,mas se der algum erro cheque a linha que deu erro se tem alguma tag ne la
local stor, limit = 7575, 5 --storage, limit to add.
local allow_container = false --empty! not looted with items, atleast for now.
function onSay(cid, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]
if (action:lower() == 'check') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):explode(',')
end
local txt = 'Autoloot List:\n'
if (#list > 0) then
for k, id in ipairs(list) do
id = id:gsub('_', '')
if tonumber(id) then
txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '')
end
end
else
txt = 'Empty'
end
doPlayerPopupFYI(cid, txt)
elseif (action:lower() == 'add') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list >= limit) then
return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
end
end
if not allow_container and isItemContainer(item) then
return doPlayerSendCancel(cid, 'Este item não pode ser autolooted.')
end
local attrs = getItemInfo(item)
if not attrs then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
elseif not attrs.movable or not attrs.pickupable then
return doPlayerSendCancel(cid, 'este item não podem ser autolooted.')
end
if isInArray(list, item) then
return doPlayerSendCancel(cid, 'Ja foi adicionado.')
end
table.insert(list, tostring(item))
local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< foi adicionado à lista de autoloot.')
elseif (action:lower() == 'remove') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list == 0) then
return doPlayerSendCancel(cid, 'Você não tem nenhum item adicionado.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'item não válido.')
end
end
if not isInArray(list, item) then
return doPlayerSendCancel(cid, 'Este item não está na lista.')
end
local new = ''
for v, id in ipairs(list) do
if (tonumber(id) ~= item) then
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
end
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removido da lista de autoloot.')
end
return true
end
info
Grupo: Conde
Registrado: 30/04/11
Posts: 658
Reputação: +71
Gênero: Masculino
Char no Tibia: ExTibiano
Algem ajuda a descobrir qual o erro desse script por favor o erro ée esse:
[19/06/2012 20:15:40] [Error - LuaScriptInterface::loadFile] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '['
[19/06/2012 20:15:40] [Warning - Event::loadScript] Cannot load script (data/talkactions/scripts/aloot.lua)
[19/06/2012 20:15:40] data/talkactions/scripts/aloot.lua:2: unexpected symbol near '['
local stor, limit = 7575, 5 --storage, limit to add.[/size][/color][/font]
local allow_container = false --empty! not looted with items, atleast for now.
function onSay(cid, words, param)
local expl = param:explode(':')
local action, rst = expl[1], expl[2]
if (action:lower() == 'check') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):explode(',')
end
local txt = 'Autoloot List:\n'
if (#list > 0) then
for k, id in ipairs(list) do
id = id:gsub('_', '')
if tonumber(id) then
txt = txt .. getItemNameById(tonumber(id)) .. ((k < #list) and '\n' or '')
end
end
else
txt = 'Empty'
end
doPlayerPopupFYI(cid, txt)
elseif (action:lower() == 'add') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list >= limit) then
return doPlayerSendCancel(cid, 'You already have ' .. limit .. ' autolooting items.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
end
end
if not allow_container and isItemContainer(item) then
return doPlayerSendCancel(cid, 'Este item não pode ser autolooted.')
end
local attrs = getItemInfo(item)
if not attrs then
return doPlayerSendCancel(cid, 'Esse item nao existe.')
elseif not attrs.movable or not attrs.pickupable then
return doPlayerSendCancel(cid, 'este item não podem ser autolooted.')
end
if isInArray(list, item) then
return doPlayerSendCancel(cid, 'Ja foi adicionado.')
end
table.insert(list, tostring(item))
local new = ''
for v, id in ipairs(list) do
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< foi adicionado à lista de autoloot.')
elseif (action:lower() == 'remove') then
local infos, list = getPlayerStorageValue(cid, stor), {}
if (infos ~= -1) then
list = tostring(infos):gsub('_', ''):explode(',')
end
if (#list == 0) then
return doPlayerSendCancel(cid, 'Você não tem nenhum item adicionado.')
end
local item = tonumber(rst)
if not item then
item = getItemIdByName(rst, false)
if not item then
return doPlayerSendCancel(cid, 'item não válido.')
end
end
if not isInArray(list, item) then
return doPlayerSendCancel(cid, 'Este item não está na lista.')
end
local new = ''
for v, id in ipairs(list) do
if (tonumber(id) ~= item) then
new = new .. '_' .. id:gsub('_' ,'') .. ((v < #list) and ',' or '')
end
end
doPlayerSetStorageValue(cid, stor, tostring(new))
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, 'Item >>' .. getItemNameById(item) .. '<< removido da lista de autoloot.')
end
return true
end
Já tentei arrumar mais n consegui :s do REP+
Editado Junho 19 por ChuckNorris666