E aew ;D
Hj vou ensinar como criar uma BOX para server de POKETIBIA!
Script testado em: Pokeserver [TFS] 0.3.6 v4.1
Começando, criei um arquivo chamado box4.lua em \data\actions\scripts\box
Se ja tiver algum documento com mesmo nome substitua.
Dentro do arquivo coloque isso:
function onUse(cid, item, frompos, item2, topos)
local box = {
[1] ={msg = "You opened the box [+4]",np = 'mew Pokeball'},
[2] ={msg = "You opened the box [+4]",np = 'mewtwo Pokeball'},
[3] ={msg = "You opened the box [+4]",np = 'zapdos Pokeball'},
[4] ={msg = "You opened the box [+4]",np = 'moltres Pokeball'},
[5] ={msg = "You opened the box [+4]",np = 'articuno Pokeball'},
}
local level = 50
local e = box[math.random(1,28)]
local boxid = 2531
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, "Vc precisa de "..level.." para usar esta box.")
end
return TRUE
end
Vermelho: Pokemons que serao sorteados (vc ganha um poke quando da use) OBS: tome cuidado
com as letras maiusculas e minusculas, pois pode bugar! example: mewtwo Pokeball, nome do poke minusculo, Pokeball com incial maiuscula.
Verde: Level que podera usar a box.
Rosa: Aconselho deixar assim. mais eh pra diferenciar os pokemons.
Azul: Id da pokebola.
Pokeballs:
[2149]Pokeball
[2521]Masterball
[2150]Ultraball
[2146]Greatball
[2147]Superball
Agora em \SEUSERVIDOR\data\actions, abra o documento actions.xml com o bloco de notas
e adicione isto em qualquer lugar:
<action itemid="7891" event="script" value="box/box4.lua"/>
Eh isso ;D
Gostou? +REP