Boa noite, Tou testando meu ot deu um erro quando tentei usa headbutt com o chikorita ai apareceu o erro e o pokemon ele não se move mais. Eu tentei remover esse mais não consigo.
[24/11/2015 19:30:47] [Error - Action Interface] [24/11/2015 19:30:47] In a timer event called from: [24/11/2015 19:30:47] data/actions/scripts/order.lua:onUse [24/11/2015 19:30:47] Description: [24/11/2015 19:30:47] data/lib/order.lua:248: attempt to get length of local 'array' (a nil value) [24/11/2015 19:30:48] stack traceback: [24/11/2015 19:30:48] data/lib/order.lua:248: in function <data/lib/order.lua:206>
["ride"] = {"let me ride you!", "let's ride!", "let me mount you!", "let me get on you!"},
["fly"] = {"let's fly!", "let me get on you!"},
["levitate"] = {"let's levitate!"},
["untransform"] = {"go back to normal!", "transform into yourself again!", "stop transformation!"},
["headbutt"] = {"headbutt on tree", "headbutt that tree!", "headbutt it off"}, --alterado v1.6
}
function onUse(cid, item, frompos, item2, topos)
local checkpos = topos
checkpos.stackpos = 0
if getTileThingByPos(checkpos).uid <= 0 then return true end
--------END FLY/RIDE --------
if getCreatureCondition(cid, CONDITION_OUTFIT) and (item2.uid == cid or getRecorderPlayer(topos) == cid) and (getPlayerStorageValue(cid, 17000) >= 1 or getPlayerStorageValue(cid, 17001) >= 1) then
if isInArray({460, 11675, 11676, 11677}, getTileInfo(getThingPos(cid)).itemid) then
doPlayerSendCancel(cid, "You can\'t stop flying at this height!")
return true
end
local item = getPlayerSlotItem(cid, 8)
local pokemon = getItemAttribute(item.uid, "poke")
local x = pokes[pokemon]
if getTileInfo(getThingPos(cid)).itemid >= 4820 and getTileInfo(getThingPos(cid)).itemid <= 4825 then
doPlayerSendCancel(cid, "You can\'t stop flying above the water!")
doPlayerSay(cid, ""..getPokeName(getCreatureSummons(cid)[1])..", let me get down!", 1)
doRegainSpeed(cid) --alterado v1.7
doRemoveCondition(cid, CONDITION_OUTFIT)
setPlayerStorageValue(cid, 17000, -1)
setPlayerStorageValue(cid, 17001, -1)
return true
end
-----------------------------
-------- DUEL SYSTEM ------------------------
if isPlayer(item2.uid) and (item2.uid ~= cid or getRecorderPlayer(topos) ~= cid) and getPlayerStorageValue(item2.uid, 6598754) <= -1 and getPlayerStorageValue(item2.uid, 52480) <= -1 and getCreatureOutfit(item2.uid).lookType ~= 814 then
---
if getPlayerStorageValue(cid, 52480) >= 1 then --alterado v1.6.1
return doPlayerSendTextMessage(cid, 20, "You already invited somebody to duel or already is dueling with somebody")
end
local storages = {17000, 63215, 17001, 13008, 5700}
for s = 1, #storages do
if getPlayerStorageValue(cid, storages) >= 1 then
return doPlayerSendTextMessage(cid, 20, "You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!")
end
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendTextMessage(cid, 20, "You can't do that while in PVP zone!")
end
---
local player = getRecorderPlayer(topos) --alterado v1.6.1
elseif isPlayer(item2.uid) and (item2.uid ~= cid or getRecorderPlayer(topos) ~= cid) and getPlayerStorageValue(item2.uid, 6598754) == 5 and getCreatureOutfit(item2.uid).lookType ~= 814 then
---
if getPlayerStorageValue(cid, 52481) <= -1 then
return true --alterado v1.6.1
end
if getPlayerStorageValue(cid, 52480) >= 1 then
return doPlayerSendTextMessage(cid, 20, "You already invited somebody to duel or already is dueling with somebody")
end
local storages = {17000, 63215, 17001, 13008, 5700}
for s = 1, #storages do
if getPlayerStorageValue(cid, storages) >= 1 then
return doPlayerSendTextMessage(cid, 20, "You can't do that while is Flying, Riding, Surfing, Diving or mount a bike!")
end
end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendTextMessage(cid, 20, "You can't do that while in PVP zone!")
end
--- --alterado v1.6.1 funçao agora em lib/some function.lua
local player = getRecorderPlayer(topos) --alterado v1.6.1
if (item2.uid == cid or getRecorderPlayer(topos) == cid) and (isInArray(skills["fly"], getPokemonName(mysum)) or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "flyItem") or isInArray(skills["ride"], getPokemonName(mysum))) then
--if not isPremium(cid) then
--doPlayerSendCancel(cid, "Only premium members are allowed to fly or ride.")
--return true
--end
if getPlayerStorageValue(cid, 6598754) == 1 or getPlayerStorageValue(cid, 6598755) == 1 then
return doPlayerSendCancel(cid, "You can't do it while in the PVP Zone!") --alterado v1.7
end
if getPlayerStorageValue(cid, 212124) >= 1 then --alterado v1.6
return doPlayerSendCancel(cid, "You can't do it with a pokemon with mind controlled!")
end
if getPlayerStorageValue(cid, 52480) >= 1 then
return doPlayerSendCancel(cid, "You can't do it while a duel!") --alterado v1.6
end
if getPlayerStorageValue(cid, 5700) == 1 then
doPlayerSendCancel(cid, "You can't do that while is mount in a bike!") --edited proteçao pra bike
return true
end
if getPlayerStorageValue(cid, 22545) >= 1 and (isInArray(skills["fly"], getPokemonName(mysum)) or getItemAttribute(getPlayerSlotItem(cid, 8).uid, "flyItem")) then --alterado v1.4
return doPlayerSendCancel(cid, "You can't do that while in the Golden Arena!")
end
if getPlayerStorageValue(cid, 31040) >= 1 then
doPlayerSendCancel(cid, "You can't use this on a Outland.")
return true
end
local pct = getCreatureHealth(mysum) / getCreatureMaxHealth(mysum)
Pergunta
Caktchup 9
Boa noite, Tou testando meu ot deu um erro quando tentei usa headbutt com o chikorita ai apareceu o erro e o pokemon ele não se move mais. Eu tentei remover esse mais não consigo.
[24/11/2015 19:30:47] [Error - Action Interface]
[24/11/2015 19:30:47] In a timer event called from:
[24/11/2015 19:30:47] data/actions/scripts/order.lua:onUse
[24/11/2015 19:30:47] Description:
[24/11/2015 19:30:47] data/lib/order.lua:248: attempt to get length of local 'array' (a nil value)
[24/11/2015 19:30:48] stack traceback:
[24/11/2015 19:30:48] data/lib/order.lua:248: in function <data/lib/order.lua:206>
Meu data/actions/scripts/order.lua
Link para o comentário
https://xtibia.com/forum/topic/238012-error-headbutt-poketibia/Compartilhar em outros sites
16 respostass a esta questão
Posts Recomendados