- 0
suporte scripts [ERROR] Addon System
-
Quem Está Navegando 0 membros estão online
- Nenhum usuário registrado visualizando esta página.
-
Conteúdo Similar
-
- 0 respostas
- 940 visualizações
-
- 4 respostas
- 1495 visualizações
-
- 3 respostas
- 1328 visualizações
-
- 0 respostas
- 1182 visualizações
-
- 3 respostas
- 1287 visualizações
-
Pergunta
boxxer321 67
Galera, estou com esse erro em um sistema de addon:
quem puder ajudar, obrigado!
[19/02/2019 14:15:21] [Error - CreatureScript Interface]
[19/02/2019 14:15:21] In a timer event called from:
[19/02/2019 14:15:21] data/creaturescripts/scripts/addonSystem.lua:onOutfit
[19/02/2019 14:15:21] Description:
[19/02/2019 14:15:21] data/lib/011-string.lua:29: attempt to index local 'str' (a number value)
[19/02/2019 14:15:21] stack traceback:
[19/02/2019 14:15:21] data/lib/011-string.lua:29: in function 'explode'
[19/02/2019 14:15:21] data/creaturescripts/scripts/addonSystem.lua:48: in function <data/creaturescripts/scripts/addonSystem.lua:44>
addonsystem.lua:
function onOutfit(cid, old, current)
local pk = getCreatureSummons(cid)
if #pk >= 1 and getPlayerStorageValue(cid, pokeAddons[getPokemonName(pk[1])].default) >= 1 then
local oldStorages = string.explode(getPlayerStorageValue(cid, storages.addonSystem), ",")
for i = 1, #oldStorages do
for t1, t2 in pairs(stringStorages) do
if oldStorages == t1 then
setPlayerStorageValue(cid, t2, 1)
end
end
end
local oldStoragess = string.explode(getPlayerStorageValue(cid, storages.addonSystem3), ",")
for i = 1, #oldStoragess do
for t1, t2 in pairs(pokeStrings) do
if i >= 1 and oldStoragess == t1 then
setPlayerStorageValue(cid, t2, 0)
setPlayerStorageValue(cid, pokeAddons[getPokemonName(pk[1])].default, 0)
end
end
end
for id1, id2 in pairs(itensAddons) do
local a = {"addon", "addon2", "addon3", "addon4", "addon5", "addon6", "addon7"}
for i = 1, #a do
if getItemAttribute(getPlayerSlotItem(cid, 8).uid, a) == id2.addon then
setPlayerStorageValue(cid, id2.stor, 0)
setPlayerStorageValue(cid, pokeAddons[getPokemonName(pk[1])].default, 0)
else
setPlayerStorageValue(cid, pokeAddons[getPokemonName(pk[1])].default, 0)
end
end
end
setPlayerStorageValue(cid, storages.checkOutfitColor, "")
setPlayerStorageValue(cid, storages.checkOutfitColor, getPlayerStorageValue(cid, storages.checkOutfitColor)..","..getCreatureOutfit(cid).lookBody..","..getCreatureOutfit(cid).lookHead..","..getCreatureOutfit(cid).lookLegs..","..getCreatureOutfit(cid).lookFeet)
setPlayerStorageValue(cid, storages.addonSystem2, getCreatureOutfit(cid).lookType)
addEvent(doSet, 2, cid, pk)
end
return true
end
function doSet(cid, summon)
if not isCreature(cid) then return true end
if not isCreature(summon[1]) then return true end
local out = getCreatureOutfit(cid)
local colors = string.explode(getPlayerStorageValue(cid, storages.checkOutfitColor), ",")
doSetCreatureOutfit(summon[1], {lookType = getCreatureOutfit(cid).lookType, lookBody = out.lookBody, lookHead = out.lookHead, lookLegs = out.lookLegs, lookFeet = out.lookFeet}, -1)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "color1", out.lookBody)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "color2", out.lookHead)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "color3", out.lookLegs)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "color4", out.lookFeet)
doItemSetAttribute(getPlayerSlotItem(cid, 8).uid, "addonNow", getCreatureOutfit(cid).lookType)
doCreatureChangeOutfit(cid, {lookType = getPlayerStorageValue(cid, storages.addonSystem2), lookBody = colors[1], lookHead = colors[2], lookLegs = colors[3], lookFeet = colors[4]})
end
011-string.lua:
string.split = function (str)
local t = {}
return not str:gsub("%w+", function(s) table.insert(t, s) return "" end):find("%S") and t or {}
end
string.trim = function (str)
return str:gsub("^%s*(.-)%s*$", "%1")
end
string.explode = function (str, sep, limit)
if(type(sep) ~= 'string' or isInArray({tostring(str):len(), sep:len()}, 0)) then
return {}
end
local i, pos, tmp, t = 0, 1, "", {}
for s, e in function() return string.find(str, sep, pos) end do
tmp = str:sub(pos, s - 1):trim()
if tmp ~= "" then --alterado v1.8
table.insert(t, tmp)
end
pos = e + 1
i = i + 1
if(limit ~= nil and i == limit) then
break
end
end
tmp = str:sub(pos):trim()
if tmp ~= "" then --alterado v1.8
table.insert(t, tmp)
end
return t
end
string.expand = function (str)
return string.gsub(str, "$(%w+)", function(n) return _G[n] end)
end
string.timediff = function (diff)
local format = {
{"week", diff / 60 / 60 / 24 / 7},
{"day", diff / 60 / 60 / 24 % 7},
{"hour", diff / 60 / 60 % 24},
{"minute", diff / 60 % 60},
{"second", diff % 60}
}
local t = {}
for k, v in ipairs(format) do
local d, tmp = math.floor(v[2]), ""
if(d > 0) then
tmp = (k < table.maxn(format) and (table.maxn(t) > 0 and ", " or "") or " and ") .. d .. " " .. v[1] .. (d ~= 1 and "s" or "")
table.insert(t, tmp)
end
end
return t
end
Link para o comentário
Compartilhar em outros sites
8 respostass a esta questão
Posts Recomendados