Postado Abril 16, 2018 7 anos Autor 11 horas atrás, henriquesafadao disse: local topos = {x=0000, y=0000, z=0} -- Posição para onde o player será teleportado. local starterpokes = { ["Torchic"] = {x = 1343, y = 989, z = 10}, ["Chinchar"] = {x = 1341, y = 989, z = 10}, ["Cyndaquil"] = {x = 1345, y = 989, z = 10}, ["Charmander"] = {x = 1347, y = 989, z = 10}, ["Treecko"] = {x = 1353, y = 989, z = 10}, ["Chikorita"] = {x = 1355, y = 989, z = 10}, ["Bulbasaur"] = {x = 1357, y = 989, z = 10}, ["Turtwig"] = {x = 1351, y = 989, z = 10}, ["Mudkip"] = {x = 1363, y = 989, z = 10}, ["Piplup"] = {x = 1361, y = 989, z = 10}, ["Totodile"] = {x = 1365, y = 989, z = 10}, ["Squirtle"] = {x = 1367, y = 989, z = 10}, } local btype = "normal" function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) > 5 then if doTeleportThing(cid, topos) 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 if getPlayerStorageValue(cid, 9658754) ~= 1 then sendMsgToPlayer(cid, 27, "Fale com o professor Robert para escolher sua cidade inicial primeiro!") return true end --alterado v1.9 \/ doPlayerSendTextMessage(cid, 27, "Voce tem o seu primeiro pokemon! Você tambem recebeu algumas pokeballs para ajuda lo em seu caminho.") doPlayerSendTextMessage(cid, 27, "Nao se esqueça de usar a sua pokedex em todos os pokemon desconhecidos!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) local item1 = doPlayerAddItem(cid, 2391, 5) doItemSetAttribute(item1, "unique", getCreatureName(cid)) local item2 = doPlayerAddItem(cid, 12346, 5) doItemSetAttribute(item2, "unique", getCreatureName(cid)) local item3 = doPlayerAddItem(cid, 2152, 5) doItemSetAttribute(item3, "unique", getCreatureName(cid)) local item4 = doPlayerAddItem(cid, 12344, 5) doItemSetAttribute(item4, "unique", getCreatureName(cid)) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) return TRUE end BUG Spoiler [16/04/2018 20:29:36] [Error - LuaScriptInterface::loadFile] data/actions/scripts/starter.lua:60: 'end' expected (to close 'function' at line 19) near '<eof>' [16/04/2018 20:29:36] [Warning - Event::loadScript] Cannot load script (data/actions/scripts/starter.lua) [16/04/2018 20:29:36] data/actions/scripts/starter.lua:60: 'end' expected (to close 'function' at line 19) near '<eof>'
Postado Abril 16, 2018 7 anos local starterpokes = { ["Torchic"] = {x = 1343, y = 989, z = 10}, ["Chinchar"] = {x = 1341, y = 989, z = 10}, ["Cyndaquil"] = {x = 1345, y = 989, z = 10}, ["Charmander"] = {x = 1347, y = 989, z = 10}, ["Treecko"] = {x = 1353, y = 989, z = 10}, ["Chikorita"] = {x = 1355, y = 989, z = 10}, ["Bulbasaur"] = {x = 1357, y = 989, z = 10}, ["Turtwig"] = {x = 1351, y = 989, z = 10}, ["Mudkip"] = {x = 1363, y = 989, z = 10}, ["Piplup"] = {x = 1361, y = 989, z = 10}, ["Totodile"] = {x = 1365, y = 989, z = 10}, ["Squirtle"] = {x = 1367, y = 989, z = 10}, } local topos = {x=0000, y=0000, z=0} local btype = "normal" function onUse(cid, item, frompos, item2, topos) if getPlayerLevel(cid) > 5 then if doTeleportThing(cid, topos) 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 if getPlayerStorageValue(cid, 9658754) ~= 1 then sendMsgToPlayer(cid, 27, "Fale com o professor Robert para escolher sua cidade inicial primeiro!") return true end --alterado v1.9 \/ doPlayerSendTextMessage(cid, 27, "Voce tem o seu primeiro pokemon! Você tambem recebeu algumas pokeballs para ajuda lo em seu caminho.") doPlayerSendTextMessage(cid, 27, "Nao se esqueça de usar a sua pokedex em todos os pokemon desconhecidos!") addPokeToPlayer(cid, pokemon, 0, nil, btype, true) local item1 = doPlayerAddItem(cid, 2391, 5) doItemSetAttribute(item1, "unique", getCreatureName(cid)) local item2 = doPlayerAddItem(cid, 12346, 5) doItemSetAttribute(item2, "unique", getCreatureName(cid)) local item3 = doPlayerAddItem(cid, 2152, 5) doItemSetAttribute(item3, "unique", getCreatureName(cid)) local item4 = doPlayerAddItem(cid, 12344, 5) doItemSetAttribute(item4, "unique", getCreatureName(cid)) doSendMagicEffect(getThingPos(cid), 29) doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid))) doSendMagicEffect(getThingPos(cid), 27) doSendMagicEffect(getThingPos(cid), 29) return TRUE end Testei é foi mais tenta ae, Si de o mesmo erro adiciona um end no fim ficano return TRUE end end Editado Abril 16, 2018 7 anos por henriquesafadao (veja o histórico de edições)
Postado Abril 17, 2018 7 anos Autor agora eu no final coloquei o end como tu disse o bug saio porem nao funciona quando vo abri o bau ou clica no bau que seja ele abre o bau e nao acontece nada e no distro nao da bug
Postado Abril 17, 2018 7 anos Diretor 13 horas atrás, Bruno Maciel disse: agora eu no final coloquei o end como tu disse o bug saio porem nao funciona quando vo abri o bau ou clica no bau que seja ele abre o bau e nao acontece nada e no distro nao da bug vou fazer pra tu, me manda o box pokemon a quele que vc escolhe aleatoriamente pra mim ver como é os atributos Eu sou um entusiasta da programação apaixonado por ajudar a comunidade open source a crescer. Sempre em busca de novos desafios e oportunidades para contribuir com meu código. #OpenSource #Programação #Contribuição
Postado Abril 17, 2018 7 anos Autor 8 horas atrás, L3K0T disse: vou fazer pra tu, me manda o box pokemon a quele que vc escolhe aleatoriamente pra mim ver como é os atributos ok Spoiler local a = { [11638] = {balltype = "normal", ballid = 11826, pokemons = {"Slowpoke", "Magnemite", "Doduo", "Seel", "Grimer", "Gastly", "Drowzee", "Voltorb", "Cubone", "Koffing", "Goldeen", "Vulpix", "Tentacool", "Bulbasaur", "Charmander", "Squirtle", "Butterfree", "Beedrill", "Metapod", "Kakuna", "Raticate", "Spearow", "Ekans", "Abra", "Mankey", "Psyduck", "Pikachu", "Sandshrew", "Nidoran Female", "Nidoran Male", "Zubat", "Diglett", "Venonat", "Meowth", "Poliwag", "Growlithe", "Machop", "Ponyta", "Geodude"}}, [11639] = {balltype = "great", ballid = 11832, pokemons = {"Pidgeotto", "Weepinbell", "Clefairy", "Omanyte", "Kabuto", "Arbok", "Raichu", "Nidorino", "Nidorina", "Dodrio", "Muk", "Golbat", "Gloom", "Parasect", "Venomoth", "Dugtrio", "Persian", "Poliwhirl", "Victreebel", "Machoke", "Graveler", "Slowbro", "Magneton", "Farfetch'd", "Haunter", "Kingler", "Electrode", "Weezing", "Rhyhorn", "Seadra", "Jigglypuff", "Seaking", "Tauros", "Starmie", "Eevee", "Dratini", "Charmeleon", "Wartortle", "Ivysaur"}}, [11640] = {balltype = "super", ballid = 11835, pokemons = {"Pidgeot", "Fearow", "Sandslash", "Ninetales", "Vileplume", "Primeape", "Golduck", "Kadabra", "Rapidash", "Clefable", "Wigglytuff", "Dewgong", "Onix", "Cloyster", "Hypno", "Exeggutor", "Marowak", "Hitmonchan", "Hitmonlee", "Lickitung", "Chansey", "Tangela", "Mr. Mime", "Pinsir", "Vaporeon", "Jolteon", "Flareon", "Porygon", "Dragonair"}}, [11641] = {balltype = "ultra", ballid = 11829, pokemons = {"Shiny Hitmonchan", "Shiny Hitmonlee", "Shiny Abra", "Dragonite", "Snorlax", "Kabutops", "Omastar", "Ditto", "Lapras", "Gyarados", "Magmar", "Electabuzz", "Jynx", "Scyther", "Kangaskhan", "Golem", "Venusaur", "Machamp", "Poliwrath", "Arcanine", "Nidoking", "Nidoqueen", "Charizard", "Blastoise", "Tentacruel", "Alakazam", "Gengar", "Rhydon"}} } local happy = 220 function onUse(cid, item, frompos, item2, topos) local b = a[item.itemid] if not b then return true end local pokemon = b.pokemons[math.random(#b.pokemons)] local btype = b.balltype if not pokeballs[btype] then return true end doPlayerSendTextMessage(cid, 27, "You opened a pokemon prize box +"..item.itemid - (11637).."!") doPlayerSendTextMessage(cid, 27, "The prize pokemon was a "..pokemon..", congratulations!") doSendMagicEffect(getThingPos(cid), 29) addPokeToPlayer(cid, pokemon, 0, nil, btype) --alterado v1.9 doRemoveItem(item.uid, 1) 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.