FehZito 0 Postado Março 17, 2012 Share Postado Março 17, 2012 Ola a todos do forum venho aqui com outro script. O erro: Unexpeted symbol near '{' e no creaturescripts ta assim: <event type="login" name="FirstItems" event="script" value="firstitems.lua"/> local firstItems = {}firstItems[0] = -- aki o ID das vocations { 2498, -- << id dos itens 2656, 7730, 2195, 2522, 7424, } firstItems[1] = { 2498, 2656, 7730, 2195, 2522, 7424 } firstItems[2] = { 2498, 2656, 7730, 2195, 2522, 7424 } firstItems[3] = { 2498, 2492, 2470, 2195, 2522, 7438, 2352 } firstItems[4] = { 2498, 2492, 2470, 2195, 2522, 2400 } firstItems[256] = { {7620, 1}, 7590, 8472, 8473, 2420, 2789, 1969, 2313, 2293, 2305, 2261, 2268, 2304, 2274, 2286, 2315 } function onLogin(cid) if getPlayerStorageValue(cid, 30001) < 0 then local bag = doPlayerAddItem(cid, 2003, 1) local item = firstItems[getPlayerVocation(cid)] for a, b in ipairs(item) do doAddContainerItem(bag, b, 1) end setPlayerStorageValue(cid, 30001, 1) end return true end Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/ Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Março 17, 2012 Share Postado Março 17, 2012 não é isso: {7620, 1}, ? { 7620, 7590, 8472, 8473, 2420, 2789, 1969, 2313, 2293, 2305, 2261, 2268, 2304, 2274, 2286, 2315 } Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219124 Compartilhar em outros sites More sharing options...
0 alldakie 160 Postado Março 17, 2012 Share Postado Março 17, 2012 (editado) Postei junto com o Vodkart, removido. Editado Março 17, 2012 por TonyHanks Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219125 Compartilhar em outros sites More sharing options...
0 FehZito 0 Postado Março 17, 2012 Autor Share Postado Março 17, 2012 Ele tava assim e dava o mesmo erro unexpeted symbol near '{' bagid = 1988 ----id da bag inicial items = {[1] { {2498, 1}, {2656, 1}, {7730, 1}, {2195, 1}, {2522, 1}, {7424, 1}, {0, 0} }, [2] ={{itemid, quantidade}, --items druid {2498, 1}, {2656, 1}, {7730, 1}, {2195, 1}, {2522, 1}, {7424, 1}, {0, 0} }, [3] ={{itemid, quantidade}, --items pala {2498, 1}, {2492, 1}, {2470, 1}, {2195, 1}, {2522, 1}, {7438, 1}, {2352, 1} }, [4] ={itemid, quantidade}, --items kinght {2498, 1}, {2492, 1}, {2470, 1}, {2195, 1}, {2522, 1}, {2400, 1}, {0, 0}, [1] ={{itemid, quantidade}, --items bag sorc {7620, 1}, {7590, 1}, {8472, 1}, {8473, 1}, {2420, 1}, {2789, 100}, {1969, 1}, {2313, 100}, {2293, 100}, {2305, 100}, {2261, 100}, {2268, 100}, {2304, 100}, {2274, 100}, {2286, 100}, {2315, 1} }, [2] ={{itemid, quantidade}, --items bag druid {7620, 1}, {7590, 1}, {8472, 1}, {8473, 1}, {2420, 1}, {2789, 100}, {1969, 1}, {2313, 100}, {2293, 100}, {2305, 100}, {2261, 100}, {2268, 100}, {2304, 100}, {2274, 100}, {2286, 100}, {2315, 1} }, [3] ={{itemid, quantidade}, --items bag pala {7620, 1}, {7590, 1}, {8472, 1}, {8473, 1}, {2420, 1}, {2789, 100}, {1969, 1}, {2313, 100}, {2293, 100}, {2305, 100}, {2261, 100}, {2268, 100}, {2304, 100}, {2274, 100}, {2286, 100}, {2315, 1} }, [4] ={{itemid, quantidade}, --items bag kina {7620, 1}, {7590, 1}, {8472, 1}, {8473, 1}, {2420, 1}, {2789, 100}, {1969, 1},} {2313, 100}, {2293, 100}, {2305, 100}, {2261, 100}, {2268, 100}, {2304, 100}, {2274, 100}, {2286, 100}, {2315, 1} },} --items que vem na bag,pode adionar mais,desdeque n seja mais do que a bag suporta function onLogin(cid) if getCreatureName(cid) == "Account Manager" then return true end z = getPlayerVocation(cid) if z > 4 then z = z - 4 end x = 1 while x <= 6 do j = getPlayerSlotItem(cid, x) doRemoveItem(j.uid, 1) x = x + 1 end i = 1 while i <= #items do doPlayerAddItem(cid, items[z][1], items[z][2]) i = i + 1 end local bag = getPlayerItemById(cid, false, bagid).uid k = 1 while k <= #bagitems do doAddContainerItem(bag, bagitems[k][z][1], bagitems[k][z][2]) k = k + 1 end return true end Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219130 Compartilhar em outros sites More sharing options...
0 alldakie 160 Postado Março 17, 2012 Share Postado Março 17, 2012 (editado) Tenta assim: local firstItems = {} firstItems[0] = { 2498, 2656, 7730, 2195, 2522, 7424, } firstItems[1] = { 2498, 2656, 7730, 2195, 2522, 7424 } firstItems[2] = { 2498, 2656, 7730, 2195, 2522, 7424 } firstItems[3] = { 2498, 2492, 2470, 2195, 2522, 7438, 2352 } firstItems[4] = { 2498, 2492, 2470, 2195, 2522, 2400 } firstItems[256] = { 7620, 7590, 8472, 8473, 2420, 2789, 1969, 2313, 2293, 2305, 2261, 2268, 2304, 2274, 2286, 2315 } function onLogin(cid) if getPlayerStorageValue(cid, 30001) == -1 then for i = 1, table.maxn(firstItems[getPlayerVocation(cid)]) do doPlayerAddItem(cid, firstItems[getPlayerVocation(cid)], 1) end if getPlayerSex(cid) == 0 then doPlayerAddItem(cid, 2554, 1) else doPlayerAddItem(cid, 2120, 1) end local bag = doPlayerAddItem(cid, 2003, 1) setPlayerStorageValue(cid, 30001, 1) end return TRUE end Ou, veja um tutorial: http://www.xtibia.co...a-e-explicando/ Editado Março 17, 2012 por TonyHanks Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219148 Compartilhar em outros sites More sharing options...
0 FehZito 0 Postado Março 17, 2012 Autor Share Postado Março 17, 2012 (editado) ele funfo mais so da uma vez quero que de toda a hora que logar. e quero que de uma bp com as runas {7620, 7590, 8472, 8473, 2420, 2789, 1969, 2313, 2293, 2305, 2261, 2268, 2304, 2274, 2286, 2315 } Editado Março 17, 2012 por FehZito Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219180 Compartilhar em outros sites More sharing options...
0 Vodkart 1515 Postado Março 17, 2012 Share Postado Março 17, 2012 deixa assim: function onLogin(cid) local bag = doPlayerAddItem(cid, 2003, 1) local item = firstItems[getPlayerVocation(cid)] for a, b in ipairs(item) do doAddContainerItem(bag, b, 1) end return true end Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219198 Compartilhar em outros sites More sharing options...
0 FehZito 0 Postado Março 17, 2012 Autor Share Postado Março 17, 2012 Esse vai da uma bp com as runas? e vai dar toda a vez que o player logar? Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219206 Compartilhar em outros sites More sharing options...
0 Beeki 284 Postado Março 18, 2012 Share Postado Março 18, 2012 @Vodkart mais uma cagada minha no script de first items que eu fiz kkk, Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219537 Compartilhar em outros sites More sharing options...
0 FehZito 0 Postado Março 18, 2012 Autor Share Postado Março 18, 2012 Vlw ae, Agreço aos 2 =D Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1219579 Compartilhar em outros sites More sharing options...
0 HisashiitYamaguti 108 Postado Março 24, 2012 Share Postado Março 24, 2012 Tópico movido para a área correta, já que o pedido foi resolvido . E Fechado. Link para o comentário https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/#findComment-1223157 Compartilhar em outros sites More sharing options...
Pergunta
FehZito 0
Ola a todos do forum venho aqui com outro script.
O erro: Unexpeted symbol near '{'
e no creaturescripts ta assim:
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
Link para o comentário
https://xtibia.com/forum/topic/182690-resolvido-erro-no-first-itens/Compartilhar em outros sites
10 respostass a esta questão
Posts Recomendados