local starterpokes = {
["Gengar"] = {x = XXX, y = YYY, z = ZZZ},
}
local btype = "cherish"
function onUse(cid, item, frompos, item2, topos)
if getPlayerLevel(cid) > 30 then
return true
end
local pokemon = ""
for a, b in pairs (starterpokes) do
if isPosEqualPos(topos, b) then
pokemon = a
end
end
if pokemon == "" then return true end
doPlayerSendTextMessage(cid, 27, "Parabéns! Você ganhou um pokémon")
addPokeToPlayer(cid, pokemon, 0, nil, btype, true)
doSendMagicEffect(getThingPos(cid), 29)
return TRUE
end
Testa ai, não esquece de configurar a posição do baú





info
Grupo: Artesão
Registrado: 18/07/17
Posts: 103
Reputação: 0
Gênero: Masculino
Tenho um scrip aki,que quando o player clica no bau,recebe um pokemon,mas ele vem apenas na pokeball(Não vem nem na ultra,cherish,great...)
Alguem pode Me ajudar?
Script:
function onUse(cid,item,fropos,topos)
storage = 31526 -- Storage da quest (troque quando for fezer outra quest)
pokemon = "Gengar" -- Pokemon Que o player vai ganhar
TypeBall = "Cherish" -- type da ball
level = 30 -- Level que precisa para completar a quest
if getPlayerStorageValue(cid,storage) == -1 then
if getPlayerLevel(cid) >= level then
addPokeToPlayer(cid,pokemon,0 ,nil ,TypeBall)
doPlayerSendTextMessage(cid,25, "Parabéns você ganhou um "..pokemon.." como premio! ") -- Msg ao completar a quest
setPlayerStorageValue(cid,storage,1)
else
doPlayerSendTextMessage(cid, 26, "Desculpe, mais você precisa ter no minimo level "..level.." para completar a quest") --- Msg quando não tiver o level
end
else
doPlayerSendTextMessage(cid, 26, "Você já fez essa quest") -- Msg quando tentar fazer novamente
end
return true
end