legal seu sistema,estava vendo aqui e no "local e" também poderia ser dessa forma:
local e = box[math.random(1,#box)]
ai caso fosse adicionar mais,só colocar os numeros lá em cima xD
Por josegabriel400, 13 de dez. de 2010 em Actions e Talkactions
info
Grupo: Campones
Registrado: 07/12/10
Posts: 53
Reputação: +2

legal seu sistema,estava vendo aqui e no "local e" também poderia ser dessa forma:
local e = box[math.random(1,#box)]
ai caso fosse adicionar mais,só colocar os numeros lá em cima xD
info
Grupo: Visconde
Registrado: 11/08/10
Posts: 477
Reputação: +175
Gênero: Masculino

Aprovado :button_ok: , pois funciona, não precisava encher a tabela de mensagens se são todas iguais e podia por o script entre [ code ] [ / code ] ou [ quote ] [ / quote ]
mesmo asism bom script, vai ajudar a galera e seus servers de pokemon.
info
Grupo: Campones
Registrado: 22/05/08
Posts: 16
Reputação: +5
Char no Tibia: Ñ Tenho :(

legal seu sistema,estava vendo aqui e no "local e" também poderia ser dessa forma:
local e = box[math.random(1,#box)]
ai caso fosse adicionar mais,só colocar os numeros lá em cima xD
nem testei ais axo que funfa mas axo que do jeito q ta e mais facil pra um que n sabe mto de script configurar tipo se ele quiser ativar so alguns pokes da box e talz mas obrigado pela opiniao =)
[19/12/2010 22:46:52] [Error - Action Interface]
[19/12/2010 22:46:52] data/actions/scripts/box 4.lua:onUse
[19/12/2010 22:46:52] Description:
[19/12/2010 22:46:52] data/actions/scripts/box 4.lua:34: attempt to index global 'box' (a nil value)
[19/12/2010 22:46:53] stack traceback:
[19/12/2010 22:46:53] data/actions/scripts/box 4.lua:34: in function <data/actions/scripts/box 4.lua:1>
como ajeito isso????????
help plx
deixa pra la consiguir ajeita se foi dopuble post malls
info
Grupo: Campones
Registrado: 10/12/10
Posts: 15
Reputação: +4
Char no Tibia: Laptiberus

muito bom cara se t uconsigui criar as outras box posta rep+
info
Grupo: Campones
Registrado: 25/12/10
Posts: 53
Reputação: +17
Gênero: Masculino
Char no Tibia: Uknown

Sistema antigo mais ta funfando ![]()
info
Grupo: Campones
Registrado: 22/05/08
Posts: 16
Reputação: +5
Char no Tibia: Ñ Tenho :(
:XTibia_smile:
UFA FOI UM APERTO VIU 0.o
AGORA ENTENDO PQ TODOS QUE CRIAM UM SCRIPT N QUEREM POSTAR.......
DA UM MEDO DANADO VIU !!! NEM SEI PQ
MAS COMO EU FIZ ESSE SCRIPT SO POR CAUSA QUE A GALERA AI LIBERO O OT
AÍ VAI
EU TAVA VENU NO MAP EDITOR E ACHEI AS BOX AI PENSEI... VOU CRIAR O SCRIPT DA BOX !!!
TA 100% TESTADO POR MIM XD
DA REP + QUEM TAVA QUERENDO ESSE SCRIPT !
primeiro va em data/actions/scripts e crie um novo script chamado box 4.lua
(infelizmente eu so fiz da box 4 pq a sprite das outras boxes estao eradas :mellow: )
COLOQUE ISSU DENTRO DO box 4.lua
function onUse(cid, item, frompos, item2, topos)
local box = {
[1] ={msg = "Vc Abriu Sua BOX 4",np = 'venusaur Pokeball'},
[2] ={msg = "Vc Abriu Sua BOX 4",np = 'charizard Pokeball'},
[3] ={msg = "Vc Abriu Sua BOX 4",np = 'blastoise Pokeball'},
[4] ={msg = "Vc Abriu Sua BOX 4",np = 'pidgeot Pokeball'},
[5] ={msg = "Vc Abriu Sua BOX 4",np = 'nidoqueen Pokeball'},
[6] ={msg = "Vc Abriu Sua BOX 4",np = 'nidoking Pokeball'},
[7] ={msg = "Vc Abriu Sua BOX 4",np = 'ninetales Pokeball'},
[8] ={msg = "Vc Abriu Sua BOX 4",np = 'arcanine Pokeball'},
[9] ={msg = "Vc Abriu Sua BOX 4",np = 'poliwrath Pokeball'},
[10] ={msg = "Vc Abriu Sua BOX 4",np = 'alakazam Pokeball'},
[11] ={msg = "Vc Abriu Sua BOX 4",np = 'machamp Pokeball'},
[12] ={msg = "Vc Abriu Sua BOX 4",np = 'tentacruel Pokeball'},
[13] ={msg = "Vc Abriu Sua BOX 4",np = 'golem Pokeball'},
[14] ={msg = "Vc Abriu Sua BOX 4",np = 'dewgong Pokeball'},
[15] ={msg = "Vc Abriu Sua BOX 4",np = 'gengar Pokeball'},
[16] ={msg = "Vc Abriu Sua BOX 4",np = 'rhydon Pokeball'},
[17] ={msg = "Vc Abriu Sua BOX 4",np = 'scyther Pokeball'},
[18] ={msg = "Vc Abriu Sua BOX 4",np = 'jynx Pokeball'},
[19] ={msg = "Vc Abriu Sua BOX 4",np = 'electabuzz Pokeball'},
[20] ={msg = "Vc Abriu Sua BOX 4",np = 'magmar Pokeball'},
[21] ={msg = "Vc Abriu Sua BOX 4",np = 'gyarados Pokeball'},
[22] ={msg = "Vc Abriu Sua BOX 4",np = 'lapras Pokeball'},
[23] ={msg = "Vc Abriu Sua BOX 4",np = 'omastar Pokeball'},
[24] ={msg = "Vc Abriu Sua BOX 4",np = 'kabutops Pokeball'},
[25] ={msg = "Vc Abriu Sua BOX 4",np = 'aerodactyl Pokeball'},
[26] ={msg = "Vc Abriu Sua BOX 4",np = 'snorlax Pokeball'},
[27] ={msg = "Vc Abriu Sua BOX 4",np = 'dragonair Pokeball'},
[28] ={msg = "Vc Abriu Sua BOX 4",np = 'dragonite Pokeball'}
}
local level = 60 -- level para usar
local e = box[math.random(1,28)]
local boxid = 2531 -- id da box que vai ser dada ao jogador
if getPlayerLevel(cid) >= level then
doPlayerSendTextMessage(cid,22,e.msg)
b = doPlayerAddItem(cid, boxid, 1)
doItemSetAttribute(b, "name", e.np)
doRemoveItem(item.uid, 1)
else
doPlayerSendCancel(cid, "You must be at least level "..level.." to use this box.")
end
return TRUE
end
agora feche e salve....
va em data/actions/actions.xml
e adicione esta TAG:
<action itemid="7891" event="script" value="box 4.lua"/>
ta aí a box 4 100% funfanu igual P.O., se vc quiser vai nos itens e mude o nome para BOX 4
obs: esse é meu primeiro script entaum nem sei colocar em CODE
(SHAUSHAU) comentem ai se funfo
Obg pela atençao, [PPO] Psyko (acesse: PPO)
GENTE PLIXS DA REP +) AEW TO PRECISANU DE UM POKIM DE REPUTAÇAO
!!! E SO CLICAR :button_ok:
Editado Dezembro 13 por dedeu400