Ir para conteúdo
  • 0

Erro na distro ao colocar action


CaioValverde

Pergunta

Eu tentei colocar um sistema de cortar arvore no meu servidor e deu o seguinte erro:

 

Tentei tbm pegar o lua de um que funcionava com um amigo meu, coloquei a tag no action.xml tudo certo e continuou com o erro, alguém pode me ajudar?

 

REP++ pro que funcionar :p!

 

 

[15/05/2015 15:04:44] [Error - LuaScriptInterface::loadFile] data/actions/scripts/wood.lua:1: unexpected symbol near 'ï'
[15/05/2015 15:04:44] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/wood.lua)
[15/05/2015 15:04:44] data/actions/scripts/wood.lua:1: unexpected symbol near 'ï'
Link para o comentário
Compartilhar em outros sites

13 respostass a esta questão

Posts Recomendados

  • 0

^ Posta o script : data/actions/scripts/wood.lua

O ultimo que tentei agora foi esse:

function onUse(cid, item, fromPosition, itemEx, toPosition)
local arvoresid = {2701,2702,2703,2704}     --id das arvores que viram madeira
local madeiraid = 5901--id da madeira que sera criada
local chance = 98  -- 1 a 100
 
 
local pposition = getPlayerPosition(cid)
local random = math.random(1,100)
for i = 1, #arvoresid do
if(itemEx.uid == arvoresid or itemEx.actionid == 3666 and random <= chance) then
doCreateItem(madeiraid, 1, pposition)
doSendMagicEffect(pposition, CONST_ME_CRAPS)
doCreatureSay(cid, getCreatureName(cid) .. ' cortou madeira', TALKTYPE_ORANGE_1)
end end
end

Tentei esse tbm:

 

 

 
local config = {
trees = {2701,2702,2703,2704,2705,2706,2707,2708,2709,2710,2712, 2714, 2717,2718,2720,2722},
t = {
[{1, 100}] = {tree = 2701},
[{101, 200}] = {tree = 2702},
[{201, 300}] = {tree = 2703},
[{301, 400}] = {tree = 2704},
[{401, 500}] = {tree = 2705},
[{501, 600}] = {tree = 2706},
[{601, 700}] = {tree = 2707},
[{701, 800}] = {tree = 2708},
[{801, 900}] = {tree = 2709},
[{901, 1000}] = {tree = 2710},
[{1001, 1100}] = {tree = 2712},
[{1101, 1200}] = {tree = 2717},
[{1201, 1300}] = {tree = 2718},
[{1301, 1400}] = {tree = 2720},
[{1401, 1500}] = {tree = 2722}
},
level = 1,
skill = SKILL_AXE,
skillReq = 10,
effect = CONST_ME_BLOCKHIT,
addTries = 100,
branches = 8807,
msgType = MESSAGE_EVENT_ADVANCE,
soul = 3,
minutes = 10
}
 
local t = {
[{1, 500}] = {msg = "Você cortou a árvore e conseguiu um pouco de madeira.", item = 5901, amountmax = 3},
[{501, 520}] = {msg = "Seu machado bateu forte e quebrou!", destroy = true},
[{521, 1550}] = {msg = "Você cortou a árvore, mas a madeira não era boa."},
[{1551, 1850}] = {msg = "A árvore caiu encima de você!", damage = {1, 100}},
[{1851, 2100}] = {msg = "Você cortou a árvore e conseguiu bastante madeira!", item = 5901, amountmax = 5},
[{2101, 2250}] = {msg = "Um gato saltou da árvore enquanto você cortava.", summon = "Cat"},
[{2251, 2350}] = {msg = "Encontrou ovos num ninho de pássaro", item = 2695, amountmax = 5},
[{2351, 2750}] = {msg = "Um rato pulou da árvore!", summon = "Rat"},
[{2750, 2850}] = {msg = "Um pássaro voa da árvore!", summon = "Seagull"},
[{2851, 3000}] = {msg = "Um inseto salta da árvore!", summon = "Bug"}
}
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
if isInArray(config.trees, itemEx.itemid) and config.level <= getPlayerLevel(cid) and config.skillReq <= getPlayerSkill(cid, config.skill) and config.soul <= getPlayerSoul(cid) then
local v, amount, damage = math.random(3000), 1, nil
for i, k in pairs(t) do
if v >= i[1] and v <= i[2] then
if k.destroy then
doRemoveItem(item.uid)
end
if k.summon then
doCreateMonster(k.summon, toPosition)
end
if k.damage then
damage = math.random(k.damage[1], k.damage[2])
doCreatureAddHealth(cid, - damage)
doSendMagicEffect(getThingPos(cid), CONST_ME_DRAWBLOOD)
doSendAnimatedText(getThingPos(cid), damage, TEXTCOLOR_RED)
 
end
if k.item then
if k.amountmax then
amount = math.random(k.amountmax)
end
doPlayerAddItem(cid, k.item, amount)
end
if k.msg then
local msg = k.msg
doPlayerSendTextMessage(cid, config.msgType, msg)
end
 
local function newTrees(parameter)
local tree = getThingfromPos{x = parameter.position.x, y = parameter.position.y, z = parameter.position.z, stackpos = 1}
for i2, k2 in pairs(config.t) do
local v2 = math.random(1500), 1, nil
if v2 >= i2[1] and v2 <= i2[2] then
if k2.tree then
if (tree.itemid == config.branches) then
doTransformItem(tree.uid, k2.tree)
end
end
end
end
end
addEvent(newTrees, config.minutes*60*1000, {position = toPosition, cid = cid})
doTransformItem(itemEx.uid, config.branches)
doPlayerAddSoul(cid, -config.soul)
doSendMagicEffect(toPosition, k.destroy and CONST_ME_HITAREA or config.effect)
return doPlayerAddSkillTry(cid, config.skill, config.addTries)
end
end
 
end
return doPlayerSendCancel(cid, "Você só pode cortar árvores.")
end
Editado por CaioValverde
Link para o comentário
Compartilhar em outros sites

  • 0

 

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local arvoresid = {2701, 2702, 2703, 2704}
    local madeiraid = 5901
    local chance = 98  
    local pposition = getPlayerPosition(cid)
    local random = math.random(1,100)
    for i = 1, #arvoresid do
        if(itemEx.uid == arvoresid or itemEx.actionid == 3666 and random <= chance) then
            doCreateItem(madeiraid, 1, pposition)
            doSendMagicEffect(pposition, CONST_ME_CRAPS)
            doCreatureSay(cid, getCreatureName(cid) .. ' cortou madeira', TALKTYPE_ORANGE_1)
        end
    end
    return true
end
Link para o comentário
Compartilhar em outros sites

  • 0
function onUse(cid, item, fromPosition, itemEx, toPosition)
    local arvoresid = {2701, 2702, 2703, 2704}
    local madeiraid = 5901
    local chance = 98  
    local pposition = getPlayerPosition(cid)
    local random = math.random(1,100)
    for i = 1, #arvoresid do
        if(itemEx.uid == arvoresid or itemEx.actionid == 3666 and random <= chance) then
            doCreateItem(madeiraid, 1, pposition)
            doSendMagicEffect(pposition, CONST_ME_CRAPS)
            doCreatureSay(cid, getCreatureName(cid) .. ' cortou madeira', TALKTYPE_ORANGE_1)
        end
    end
    return true
end

Mesma coisa Zipter:

[16/05/2015 01:35:12] [Error - LuaScriptInterface::loadFile] data/actions/scripts/wood.lua:1: unexpected symbol near 'ï'
[16/05/2015 01:35:12] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/wood.lua)
[16/05/2015 01:35:12] data/actions/scripts/wood.lua:1: unexpected symbol near 'ï'

EDIT: Achei que o erro era o serv que eu tinha, baixei um que o Kronos me mandou, coloquei o script deu o mesmo erro. '0'

Editado por CaioValverde
Link para o comentário
Compartilhar em outros sites

×
×
  • Criar Novo...