jhon44370 0 Postado Novembro 22, 2010 Share Postado Novembro 22, 2010 (editado) here I bring the box 1 as svke: D your server / / data / / actions / / scripts --- box with the name: function onUse(cid, item, frompos, item2, topos) r1 = math.random(1,17) if getPlayerLevel(cid) >= 8 then if doPlayerRemoveItem(cid,7884,1) == TRUE then if r1 == 17 then doPlayerSendTextMessage(cid,22,"Você ganhou um Caterpie.") doPlayerAddItem(cid,2128,1) elseif r1 == 1 then doPlayerSendTextMessage(cid,22,"Você ganhou um Weedle.") doPlayerAddItem(cid,2129,1) elseif r1 == 2 then doPlayerSendTextMessage(cid,22,"Você ganhou um ratata.") doPlayerAddItem(cid,2129,1) elseif r1 == 3 then doPlayerSendTextMessage(cid,22,"Você ganhou um Metapod.") doPlayerAddItem(cid,2129,1) elseif r1 == 4 then doPlayerSendTextMessage(cid,22,"Você ganhou um Kakuna.") doPlayerAddItem(cid,2129,1) elseif r1 == 5 then doPlayerSendTextMessage(cid,22,"Você ganhou um Spearow.") doPlayerAddItem(cid,2129,1) elseif r1 == 6 then doPlayerSendTextMessage(cid,22,"Você ganhou um Diglett.") doPlayerAddItem(cid,2129,1) elseif r1 == 7 then doPlayerSendTextMessage(cid,22,"Você ganhou um Zubat.") doPlayerAddItem(cid,2129,1) elseif r1 == 8 then doPlayerSendTextMessage(cid,22,"Você ganhou um Paras.") doPlayerAddItem(cid,2129,1) elseif r1 == 9 then doPlayerSendTextMessage(cid,22,"Você ganhou um Pidgey.") doPlayerAddItem(cid,2130,1) elseif r1 == 10 then doPlayerSendTextMessage(cid,22,"Você ganhou um Oddish.") doPlayerAddItem(cid,2129,1) elseif r1 == 11 then doPlayerSendTextMessage(cid,22,"Você ganhou um Poliwag.") doPlayerAddItem(cid,2129,1) elseif r1 == 12 then doPlayerSendTextMessage(cid,22,"Você ganhou um Krabby.") doPlayerAddItem(cid,2129,1) elseif r1 == 13 then doPlayerSendTextMessage(cid,22,"Você ganhou um Exeggcute.") doPlayerAddItem(cid,2129,1) elseif r1 == 14 then doPlayerSendTextMessage(cid,22,"Você ganhou um Horsea.") doPlayerAddItem(cid,2129,1) elseif r1 == 15 then doPlayerSendTextMessage(cid,22,"Você ganhou um Goldeen.") doPlayerAddItem(cid,2129,1) elseif r1 == 16 then doPlayerSendTextMessage(cid,22,"Você ganhou um Magikarp.") doPlayerAddItem(cid,2129,1) end end end end in actionsxml gently place: itemid="7884" <action event="script" value="box.lua"/> thanks: D when they want the other box ago as svke: D Editado Novembro 22, 2010 por jhon44370 Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/ Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Novembro 22, 2010 Share Postado Novembro 22, 2010 hello friend,thanks for your contribution,most already exists this same script here... Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/#findComment-961653 Compartilhar em outros sites More sharing options...
Faisher 6 Postado Novembro 22, 2010 Share Postado Novembro 22, 2010 (editado) I have posted on the other BR forum the same script but more simplified. local pokes = { [1] = {name = Pidgey, health = 100, maxhealth = 100}, [2] = {name = Caterpie, health = 100, maxhealth = 100}, [3] = {name = Rattata, health = 100, maxhealth = 100}, [4] = {name = Weedle, health = 100, maxhealth = 100}, } function onUse(cid, item, frompos, item2, topos) local s = doPlayerAddItem(cid, 2661) local rand = pokes[math.random(1,4)] if getPlayerLevel(cid) >= 5 then if doPlayerRemoveItem(cid,7884,1) then if rand then doItemSetAttribute(s, "poke", "This is ".. rand.name .."'s pokeball. HP = ["..rand.health.."/"..rand.maxhealth.."]") doItemSetAttribute(s, "description", "Contains a ".. rand.name ..".") doSendMagicEffect(topos, 29) doPlayerSendTextMessage(cid,22,"Você ganhou um ".. rand.name ..".") end else doPlayerSendCancel(cid, "You do not have required item.") end else doPlayerSendCancel(cid, "You must have level 5.") end return true end Editado Novembro 22, 2010 por Faisher Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/#findComment-961654 Compartilhar em outros sites More sharing options...
jhon44370 0 Postado Novembro 23, 2010 Autor Share Postado Novembro 23, 2010 hello friend,thanks for your contribution,most already exists this same script here... because it does what it can: D Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/#findComment-961718 Compartilhar em outros sites More sharing options...
Vodkart 1515 Postado Novembro 23, 2010 Share Postado Novembro 23, 2010 @up then in this case do not waste your time.. Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/#findComment-961902 Compartilhar em outros sites More sharing options...
Lilita 1 Postado Novembro 23, 2010 Share Postado Novembro 23, 2010 bom contributo Link para o comentário https://xtibia.com/forum/topic/145353-my-tercer-aporte-d/#findComment-961980 Compartilhar em outros sites More sharing options...
Posts Recomendados