To fazendo uma quest armadilha, quando o player usar o bau vai ser usada essa função que vai fazer aparecer efeitos na area. Só que quando uso o baú, aparece um erro no console: <luaCreateCombatArea> This function can only be used while loading the script. Alguém sabe como resolver? Link da function http://www.xtibia.com/forum/topic/152567-functionrandomizeareaarea/
Function
function RandomizeArea(area) -- by xxotservxx
for i, x in pairs(area) do
for w, z in pairs(x) do
if area[i][w] == 1 then
area[i][w] = math.random(0, 1)
end
end
end
return area
end
/actions/scrips/trap2.lua
function onUse(cid, item, frompos, item2, topos)
portafechada = 18473 -- coloque aqui o ID da porta fechada
portaaberta = 18473 -- coloque aqui o ID da porta aberta
uidporta = 9041 -- coloque aqui o UID da porta
idkey = 13292 -- coloque aqui o id da key
local t = {
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 3, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1},
{1, 1, 1, 1, 1, 1, 1}
}
if item.itemid == idkey and item2.itemid == portafechada and item2.uid == uidporta then
doTransformItem(item2.uid,portaaberta)
elseif item.itemid == idkey and item2.itemid == portaaberta and item2.uid == uidporta then
doTransformItem(item2.uid,portafechada)
else
doPlayerPopupFYI(cid, "Você não tem a chave.")
end
RandomizeArea(t)
local area = createCombatArea(t)
function onSay(cid, words, param, channel)
return doAreaCombatHealth(cid, COMBAT_POISONDAMAGE, getThingPos(cid), area, -10000, -100000, 11)
end
return 1
end
Pergunta
NewAge 0
To fazendo uma quest armadilha, quando o player usar o bau vai ser usada essa função que vai fazer aparecer efeitos na area. Só que quando uso o baú, aparece um erro no console: <luaCreateCombatArea> This function can only be used while loading the script. Alguém sabe como resolver? Link da function http://www.xtibia.com/forum/topic/152567-functionrandomizeareaarea/
Function
/actions/scrips/trap2.lua
Link para o comentário
Compartilhar em outros sites
0 respostass a esta questão
Posts Recomendados