TopllDanStar
New Member
- Joined
- Aug 4, 2014
- Messages
- 11
- Reaction score
- 0
ai is giving this error in my distro;
data\action\script;
data\lib;
Code:
[26/10/2014 08:15:01] [Error - Action Interface]
[26/10/2014 08:15:01] data/actions/scripts/Torneio.lua:onUse
[26/10/2014 08:15:01] Description:
[26/10/2014 08:15:01] data/actions/scripts/Outland/Outland-waves.lua:45: attempt to index local 'area2' (a nil value)
[26/10/2014 08:15:01] stack traceback:
[26/10/2014 08:15:01] data/actions/scripts/Outland/Outland-waves.lua:45: in function 'getPlayersInArea'
[26/10/2014 08:15:01] data/actions/scripts/Torneio.lua:5: in function <data/actions/scripts/Torneio.lua:1>
data\action\script;
Code:
function onUse(cid, item)
if #getCreatureSummons(cid) >= 1 then
doPlayerSendCancel(cid, "[Torneio] Nao Pode Usar o Bau com Pokemon Fora Da Ball!.")
else
if #getPlayersInArea(torneio.area) > 1 then
doPlayerSendTextMessage(cid, 20 ,"Somente o Ultimo Sobrevivente poderar Usar essa Alavanca") return true end
doTeleportThing(cid, torneio.playerTemple)
doPlayerAddItem(cid,6569,10)
doPlayerSendTextMessage(cid, 21, "[Torneio] Jovem Treinador Parabéns, você ganhou o torneio e ganhou [10] Candy UP + ["..getItemNameById(torneio.awardTournament).."] .")
setPlayerStorageValue(cid,130131,getPlayerStorageValue(cid,130131)+1)
doPlayerSendTextMessage(cid,MESSAGE_EVENT_ORANGE,"[Torneio-Score] Voce Agora Tem ["..(getPlayerStorageValue(cid,130131) + 1).."] Torneio SCORES.")
doPlayerAddItem(cid, torneio.awardTournament, torneio.awardAmount)
return true
end
end
data\lib;
Code:
torneio = {
awardTournament = 2160,---- Premio
awardAmount = 100,---- quantia do Premio
playerTemple = {x = 1051, y = 1049, z = 7}, ---- posiçao do Templo
tournamentFight = {x = 1037, y = 1073, z = 7}, ----- Area (Mapa) do torneio
area = {fromx = 1034, fromy = 1073, fromz = 7, tox = 1040, toy = 1073, toz= 7},---- fromx = 899, fromy = 968, fromz = 7 : posiçao superior a esquerda do Mapa do torneio /// tox = 919, toy = 989, toz= 7 : Posiçao inferior direito do Mapa do Torneio
waitPlace = {x = 1052, y = 1074, z = 7}, ---- Sala de Espera (Coloque No-logout na area)
waitArea = {fromx = 1050, fromy = 1074, fromz = 7, tox = 1054, toy = 1074, toz= 7}, ---- fromx = 899, fromy = 968, fromz = 7 : posiçao superior a esquerda do Mapa Sala de espera /// tox = 919, toy = 989, toz= 7 : Posiçao inferior direito do Mapa sala de espera
startHour = "08:07:00", ---- Hora que Inicia as Iscriçoes do Torneio
endHour = "08:10:00", ----- Hora que Começa a Batalha
price = 10000, ------ Custo para se inscrever no torneio
}
function getPlayersInArea(area)
local players = {}
for x = area.fromx,area.tox do
for y = area.fromy,area.toy do
for z = area.fromz,area.toz do
local m = getTopCreature({x=x, y=y, z=z}).uid
if m ~= 0 and isPlayer(m) then
table.insert(players, m)
end
end
end
end
return players
end