Postado Dezembro 4, 2020 4 anos Alguém poderia me ajudar a mudar algumas coisas nesse script? gostaria de remover essa quantidade de items deixando apenas 1 e que eu consiga coloca varios items diferente mas a quantidade precisa ser apenas 1 por exemplo item= {2160,EXEMPLO1,EXEMPLO2,EXEMPLO3{x=906, y=588, z=7}}} local lvl = 1 local stor_time = 68767 local hours = 1 local pos_die = {x=905, y=571, z=6} local t = { {vocations = {1, 1},Pos = {{x=912, y=583, z=7},{x=904, y=573, z=6}},item= {9020,{x=906, y=578, z=7}}}, -- DRUNK {vocations = {1, 1},Pos = {{x=910, y=579, z=7},{x=904, y=575, z=6}},item= {9020,{x=906, y=588, z=7}}}, -- PARALYZE {vocations = {1, 1},Pos = {{x=902, y=579, z=7},{x=906, y=575, z=6}},item= {9020,{x=907, y=584, z=7}}}, -- BRUISER {vocations = {1, 1},Pos = {{x=910, y=587, z=7},{x=906, y=573, z=6}},item= {9020,{x=905, y=584, z=7}}}, -- HEAL {vocations = {1, 1},Pos = {{x=900, y=583, z=7},{x=905, y=574, z=6}},item= {9020,{x=905, y=582, z=7}}}, -- ATK {vocations = {1, 1},Pos = {{x=902, y=587, z=7},{x=904, y=573, z=6}},item= {9020,{x=907, y=582, z=7}}} -- DISTANCE } function onUse(cid, item, fromPosition, itemEx, toPosition) local check = {} local items = {} for _, k in ipairs(t) do local x = getTopCreature(k.Pos[1]).uid local v = getTileItemById(k.item[2], k.item[1]) if x == 0 or not isPlayer(x) or getPlayerLevel(x) < lvl or isInArray(k.vocations, getPlayerVocation(x)) == FALSE or getPlayerStorageValue(x, stor_time) - os.time() > 0 then doPlayerSendCancel(cid, 'Está faltando player, alguém não possui level '..lvl..' ou não está transformado no maximo.') return true elseif v.uid == 0 then doPlayerSendCancel(cid, "Todos os itens precisa estar na posição.") return true end table.insert(check, x) table.insert(items, v) end local sort = check[math.random(1, #check)] for k, tid in ipairs(check) do doSendMagicEffect(getCreaturePosition(tid), CONST_ME_POFF) if tid ~= sort then doTeleportThing(tid, t[k].Pos[2]) else doTeleportThing(tid, pos_die) end doSendMagicEffect(getCreaturePosition(tid), CONST_ME_TELEPORT) setPlayerStorageValue(tid, stor_time, os.time()+hours*1) end for _, remove in ipairs(items) do doRemoveItem(remove.uid) end doTransformItem(item.uid, item.itemid == 1945 and 1946 or 1945) return true end
Participe da conversa
Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.